Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

13
LINES

< > BotCompany Repo | #1000567 // isInteger

JavaX fragment (include)

static bool isInteger(String s) {
  int n = l(s);
  if (n == 0) ret false;
  int i = 0;
  if (s.charAt(0) == '-')
    if (++i >= n) ret false;
  while (i < n) {
    char c = s.charAt(i);
    if (c < '0' || c > '9') ret false;
    ++i;
  }
  ret true;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 17 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, jozkyjcghlvl, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, wtqryiryparv

No comments. add comment

Snippet ID: #1000567
Snippet name: isInteger
Eternal ID of this version: #1000567/3
Text MD5: f6d183d11c801ec4a1fb96e06e1db2c9
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-25 18:48:36
Source code size: 264 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 852 / 7296
Version history: 2 change(s)
Referenced in: [show references]