static S firstNDigits(int n, S s) { new StringBuilder buf; for (char c : characters(s)) if (isDigit(c)) { buf.append(c); if (l(buf) >= n) break; } ret str(buf); }
Began life as a copy of #1013221
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1013237 |
Snippet name: | firstNDigits |
Eternal ID of this version: | #1013237/1 |
Text MD5: | 99296f1bd243c6e6687fdbed86296021 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-12-29 00:13:45 |
Source code size: | 196 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 333 / 375 |
Referenced in: | [show references] |