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

5
LINES

< > BotCompany Repo | #1032520 // splitAtFirst - trims all. null if no splitter found

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

Libraryless. Click here for Pure Java version (3817L/22K).

static PairS splitAtFirst(S s, S splitter) {
  int i = indexOf(s, splitter);
  if (i < 0) null;
  ret pair(trimSubstring(s, 0, i), trimSubstring(s, i+l(splitter)));
}

Author comment

Began life as a copy of #1012569

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032520
Snippet name: splitAtFirst - trims all. null if no splitter found
Eternal ID of this version: #1032520/1
Text MD5: 13893d6f561ba9eeb78f834bf8c33ae6
Transpilation MD5: d54cfbe350626a8bf94dc8e107ccad89
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-09-14 17:26:19
Source code size: 170 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 151 / 215
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)