Libraryless. Click here for Pure Java version (55L/1K).
1 | sS trim(S s) { |
2 | if (s == null) null; |
3 | int i = 0, n = s.length(), j = n; |
4 | while (i < n && " \t\r\n".indexOf(s.charAt(i)) >= 0) |
5 | ++i; |
6 | while (j > i && " \t\r\n".indexOf(s.charAt(j-1)) >= 0) |
7 | --j; |
8 | ret substring(s, i, j); |
9 | } |
Began life as a copy of #1001543
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1025045 |
Snippet name: | re-implemented trim [dev.] |
Eternal ID of this version: | #1025045/5 |
Text MD5: | 0f1284d4bf0d523192e124257ceff671 |
Transpilation MD5: | c511ff97daa44cfdadf59780914a547b |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-09-03 14:26:06 |
Source code size: | 239 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 226 / 319 |
Version history: | 4 change(s) |
Referenced in: | [show references] |