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

7
LINES

< > BotCompany Repo | #1001561 - rtrim (now includes line breaks)

JavaX fragment (include)

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

Author comment

Began life as a copy of #2000477

download  show line numbers  debug dex   

Travelled to 10 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1001561
Snippet name: rtrim (now includes line breaks)
Eternal ID of this version: #1001561/2
Text MD5: 5368c993296c9c12cbcf259991876dda
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-04-17 16:56:15
Source code size: 206 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 423 / 2326
Version history: 1 change(s)
Referenced in: [show references]