Libraryless. Click here for Pure Java version (2662L/17K).
1 | static Substring substringObject(CharSequence s, int x) {
|
2 | ret substringObject(s, x, l(s)); |
3 | } |
4 | |
5 | static Substring substringObject(CharSequence s, int x, int y) {
|
6 | if (s == null) null; |
7 | if (x < 0) x = 0; |
8 | if (x > s.length()) x = s.length(); |
9 | if (y < x) y = x; |
10 | if (y > s.length()) y = s.length(); |
11 | ret new Substring(s, x, y); |
12 | } |
Began life as a copy of #1002637
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: | #1029258 |
| Snippet name: | substringObject |
| Eternal ID of this version: | #1029258/3 |
| Text MD5: | 817ec0fd4b456b397ec4e6ed66c3aaeb |
| Transpilation MD5: | 56f9c467b80fce398ed2cf586d00e4ce |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2020-07-27 18:24:03 |
| Source code size: | 342 bytes / 12 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 456 / 607 |
| Version history: | 2 change(s) |
| Referenced in: | [show references] |