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

13
LINES

< > BotCompany Repo | #1003804 // splitAtDashLines - split at lines containing only dashes ("-"), one is enough

JavaX fragment (include)

static L<S> splitAtDashLines(S text) {
  L<S> lines = toLines(text);
  new L<S> l;
  int i = 0;
  while (i < l(lines)) {
    int j = indexOfDashLine(lines, i);
    if (j < 0) j = l(lines);
    if (j > i)
      l.add(joinLines(lines.subList(i, j)));
    i = j+1;
  }
  ret l;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1003804
Snippet name: splitAtDashLines - split at lines containing only dashes ("-"), one is enough
Eternal ID of this version: #1003804/4
Text MD5: 7463cd11669cb11c75065b27678491aa
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-02 11:16:35
Source code size: 288 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 541 / 567
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1021528 - splitAtLinePredicate - split at lines satisfying a predicate