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

7
LINES

< > BotCompany Repo | #1001543 // ltrim

JavaX fragment (include)

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

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, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1001543
Snippet name: ltrim
Eternal ID of this version: #1001543/4
Text MD5: e79d260e7e184694ace7f6fa88599cbe
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-03 14:22:27
Source code size: 186 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 711 / 934
Version history: 3 change(s)
Referenced in: #1002427 - Accellerating 629 (SPIKE)
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1007672 - xltrim - trim also line breaks
#1013628 - countLeadingSpaces - also tabs
#1025045 - re-implemented trim [dev.]
#1025046 - trimmable - TODO: check if it agrees with trim()
#3000382 - Answer for ferdie (>> t = 1, f = 0)