Libraryless. Click here for Pure Java version (3817L/22K).
1 | static PairS splitAtFirst(S s, S splitter) { |
2 | int i = indexOf(s, splitter); |
3 | if (i < 0) null; |
4 | ret pair(trimSubstring(s, 0, i), trimSubstring(s, i+l(splitter))); |
5 | } |
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: | 152 / 217 |
Referenced in: | [show references] |