Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

7
LINES

< > BotCompany Repo | #1015065 // rtrimSpaces (and tabs, but no line breaks)

JavaX fragment (include)

public static String rtrimSpaces(String s) {
  if (s == null) null;
  int i = s.length();
  while (i > 0 && " \t".indexOf(s.charAt(i-1)) >= 0)
    --i;
  return i < s.length() ? s.substring(0, i) : s;
}

Author comment

Began life as a copy of #1001561

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: #1015065
Snippet name: rtrimSpaces (and tabs, but no line breaks)
Eternal ID of this version: #1015065/4
Text MD5: 91dcdd6f6ebab4778d992274d4c0b343
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-07 17:20:29
Source code size: 208 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 352 / 794
Version history: 3 change(s)
Referenced in: [show references]