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)

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

Author comment

Began life as a copy of #2000477

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

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: 735 / 2766
Version history: 1 change(s)
Referenced in: [show references]