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

10
LINES

< > BotCompany Repo | #1014359 // standAloneLines - lines with empty lines above and below (or at beginning or end)

JavaX fragment (include)

1  
static L<S> standAloneLines(L<S> lines) {
2  
  new L<S> l;
3  
  for i over lines: {
4  
    if (nempty(get(lines, i))
5  
      && emptyAfterTrim(get(lines, i-1))
6  
      && emptyAfterTrim(get(lines, i+1)))
7  
      l.add(get(lines, i));
8  
  }
9  
  ret l;
10  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1014359
Snippet name: standAloneLines - lines with empty lines above and below (or at beginning or end)
Eternal ID of this version: #1014359/1
Text MD5: d4880fff1ffd94a445232aef54237757
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-04-20 14:52:03
Source code size: 242 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 459 / 447
Referenced in: [show references]