Libraryless. Click here for Pure Java version (2474L/16K).
static S substring(S s, int x) { ret substring(s, x, strL(s)); } static S substring(S s, int x, int y) { if (s == null) return null; if (x < 0) x = 0; int n = s.length(); if (y < x) y = x; if (y > n) y = n; if (x >= y) ret ""; return s.substring(x, y); } ifclass IntRange static S substring(S s, IntRange r) { ret r == null ? null : substring(s, r.start, r.end); } endif // convenience method for quickly dropping a prefix sS substring(S s, CharSequence l) { ret substring(s, l(l)); }
Began life as a copy of #1001853
download show line numbers debug dex
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1002637 |
Snippet name: | substring - exception-free (safe) version of String.substring |
Eternal ID of this version: | #1002637/13 |
Text MD5: | e98b450b6054e8b2a672fe101695b8a9 |
Transpilation MD5: | 7e4c9a912f6ce02e05a123b2bebce91d |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-08-01 22:41:41 |
Source code size: | 530 bytes / 24 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 533 / 1246 |
Version history: | 12 change(s) |
Referenced in: | #1006654 #1008850 #1012683 #1028010 #1029174 #1029258 #3000382 |
Formerly at http://tinybrain.de/1002637 & http://1002637.tinybrain.de