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

11
LINES

< > BotCompany Repo | #1014769 // startingWithEndingWith_drop - drop prefix & suffix

JavaX fragment (include)

static L<S> startingWithEndingWith_drop(Collection<S> l, fS prefix, fS suffix) {
  new L<S> out;
  for (S s : unnull(l))
    if (startsWithEndsWith(s, prefix, suffix))
      out.add(substring(s, l(prefix), l(s)-l(suffix)));
  ret out;
}

static L<S> startingWithEndingWith_drop(S prefix, S suffix, Collection<S> l) {
  ret startingWithEndingWith_drop(l, prefix, suffix);
}

Author comment

Began life as a copy of #1008863

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: #1014769
Snippet name: startingWithEndingWith_drop - drop prefix & suffix
Eternal ID of this version: #1014769/1
Text MD5: 37c34446cb5c945bd9695f715f0d7725
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-01 22:13:01
Source code size: 382 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 412 / 445
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1016959 - startingWithICTrim_drop - drop prefix & trim