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

10
LINES

< > BotCompany Repo | #1005054 // extractMarkedLines

JavaX fragment (include)

static L<S> extractMarkedLines(S text, BitSet marking) {
  new L<S> l;
  L<Int> indexes = lineStartIndexes(text);
  for (int i : indexes) {
    int j = smartIndexOf(text, "\n", i);
    if (anyBitSetInRange(marking, i, j+1))
      l.add(substring(text, i, j));
  }
  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: #1005054
Snippet name: extractMarkedLines
Eternal ID of this version: #1005054/1
Text MD5: f17189efc9ae664f6d651eaf35514568
Author: stefan
Category: javax / text analysis
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-10-03 20:50:53
Source code size: 283 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 556 / 555
Referenced in: [show references]