1 | public static String rtrim(String s) { |
2 | int i = s.length(); |
3 | while (i > 0 && (s.charAt(i-1) == ' ' || s.charAt(i-1) == '\t')) |
4 | --i; |
5 | return i < s.length() ? s.substring(0, i) : s; |
6 | } |
Snippet is not live.
Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #2000477 |
Snippet name: | rtrim |
Eternal ID of this version: | #2000477/1 |
Text MD5: | 9e2d3cefc334daeedc1c75b37158ecfc |
Author: | stefan |
Category: | |
Type: | New Tinybrain snippet |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2015-08-01 18:41:32 |
Source code size: | 192 bytes / 6 lines |
Pitched / IR pitched: | No / Yes |
Views / Downloads: | 627 / 181 |
Referenced in: | [show references] |