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

12
LINES

< > BotCompany Repo | #1031224 // dropLeadingNewLines - does not drop them if they contain spaces

JavaX fragment (include)

sS dropLeadingNewLines(S s) {
  int i = 0;
  while true {
    if (substringAtIs(s, i, "\r\n"))
      i += 2;
    else if (substringAtIs(s, i, "\n"))
      i++;
    else
      break;
  }
  ret substring(s, i);
}

Author comment

Began life as a copy of #1026310

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031224
Snippet name: dropLeadingNewLines - does not drop them if they contain spaces
Eternal ID of this version: #1031224/2
Text MD5: 94789837d3e14050cffa50fb69b19d2d
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-05-21 18:36:55
Source code size: 221 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 170 / 201
Version history: 1 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1031225 - dropLeadingEmptyLines - also drop them if they contain just spaces