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

8
LINES

< > BotCompany Repo | #1025939 // splitAtFirstDoubleArrow - javaTok and split at "=>" (and trim)

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2370L/15K).

static PairS splitAtFirstDoubleArrow(S s) {
  ret splitAtFirstDoubleArrow(javaTok(s));
}

static PairS splitAtFirstDoubleArrow(LS tok) {
  int i = indexOfSubList(tok, splitAtDoubleArrow_tok());
  ret i < 0 ? null : pair(trimJoin(subList(tok, 0, i)), trimJoin(subList(tok, i+3)));
}

Author comment

Began life as a copy of #1011989

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1025939
Snippet name: splitAtFirstDoubleArrow - javaTok and split at "=>" (and trim)
Eternal ID of this version: #1025939/1
Text MD5: 0c9d9d00094010a083fa0932e143cece
Transpilation MD5: 1f6eb33c743964fa9ddb6e666790cc69
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-11-01 12:19:15
Source code size: 288 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 248 / 341
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)