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

11
LINES

< > BotCompany Repo | #1002109 // isNonNegativeInteger

JavaX fragment (include)

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

Author comment

Began life as a copy of #1000567

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, whxojlpjdney

No comments. add comment

Snippet ID: #1002109
Snippet name: isNonNegativeInteger
Eternal ID of this version: #1002109/2
Text MD5: c905ee73f0e3c082b97381b4f08e0776
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-25 18:48:47
Source code size: 221 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 1014 / 7155
Version history: 1 change(s)
Referenced in: #1002427 - Accellerating 629 (SPIKE)
#1006654 - Standard functions list 2 (LIVE, continuation of #761)