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

11
LINES

< > BotCompany Repo | #1002109 // isNonNegativeInteger

JavaX fragment (include)

1  
static boolean isNonNegativeInteger(String s) {
2  
  int n = l(s);
3  
  if (n == 0) ret false;
4  
  int i = 0;
5  
  while (i < n) {
6  
    char c = s.charAt(i);
7  
    if (c < '0' || c > '9') ret false;
8  
    ++i;
9  
  }
10  
  ret true;
11  
}

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: 891 / 7065
Version history: 1 change(s)
Referenced in: [show references]