Libraryless. Click here for Pure Java version (2137L/14K).
1 | static int endOfLeadingInteger(S s) {
|
2 | if (empty(s)) ret 0; |
3 | int start = 0; |
4 | if (s.charAt(0) == '-') ++start; |
5 | int i = start; |
6 | while (i < l(s) && isDigit(s.charAt(i))) ++i; |
7 | ret i > start ? i : 0; |
8 | } |
Began life as a copy of #1013527
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1026682 |
| Snippet name: | endOfLeadingInteger (or 0) |
| Eternal ID of this version: | #1026682/1 |
| Text MD5: | f802e9ef3e366b0a1851d96b91cbf4a7 |
| Transpilation MD5: | 0578cc0e4010adcc44f3a65505dbb97e |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2020-01-18 23:14:52 |
| Source code size: | 211 bytes / 8 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 414 / 511 |
| Referenced in: | [show references] |