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

12
LINES

< > BotCompany Repo | #1008511 // findSubstringsEnclosedBy_inner - return strings without begin/end markers

JavaX fragment (include)

// does not return unclosed strings
static L<S> findSubstringsEnclosedBy_inner(S s, char a, char b) {
  int i = 0;
  new L<S> l;
  while ((i = indexOf(s, a, i)) >= 0) {
    int j = indexOf(s, b, i+1);
    if (j < 0) break;
    l.add(substring(s, i+1, j));
    i = j+1;
  }
  ret l;
}

Author comment

Began life as a copy of #1008502

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: #1008511
Snippet name: findSubstringsEnclosedBy_inner - return strings without begin/end markers
Eternal ID of this version: #1008511/2
Text MD5: 3b07e99cdcb23e213e31468c1a0b57de
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-05-20 13:56:34
Source code size: 294 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 480 / 484
Version history: 1 change(s)
Referenced in: [show references]