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

17
LINES

< > BotCompany Repo | #1023726 // tok_findNextEmptyLineWhitespace

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (1721L/11K).

static IntRange tok_findNextEmptyLineWhitespace(S s, int i) {
  char c;
  int k = i, l = l(s);
  
  while (k < l) {
    int j = k, breaks = 0;
    while (j < l && isSpace(c = s.charAt(j))) {
      ++j;
      if (c == '\n') ++breaks;
    }
    if (breaks >= 2) ret intRange(k, j);
    while (j < l && !isSpace(s.charAt(j))) ++j;
    k = j;
  }
  
  null;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1023726
Snippet name: tok_findNextEmptyLineWhitespace
Eternal ID of this version: #1023726/3
Text MD5: 366865fe4d1563988a5e833b00eb01d8
Transpilation MD5: 9245d8e3853a231f3a3ba3c232d5776d
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-07 18:16:22
Source code size: 371 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 210 / 306
Version history: 2 change(s)
Referenced in: [show references]