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

16
LINES

< > BotCompany Repo | #1012882 // tok_splitAtSlash - javaTok and split at "/" (and trim)

JavaX fragment (include)

static L<S> tok_splitAtSlash(S s) {
  ret tok_splitAtSlash(javaTok(s));
}

static L<S> tok_splitAtSlash(L<S> tok) {
  new L<S> l;
  int i = 0;
  while (i < l(tok)) {
    if (i >= l(tok)) break;
    int j = indexOf(tok, "/", i);
    if (j < 0) j = l(tok);
    l.add(trimJoin(tok.subList(i, j)));
    i = j+1;
  }
  ret l;
}

Author comment

Began life as a copy of #1011989

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: #1012882
Snippet name: tok_splitAtSlash - javaTok and split at "/" (and trim)
Eternal ID of this version: #1012882/1
Text MD5: 7962565a9ab0cc0875aa1f4b28c57555
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-15 00:13:54
Source code size: 337 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 343 / 393
Referenced in: [show references]