1 | static S dropFrom(S s, S x) { |
2 | if (s == null) null; |
3 | int i = s.indexOf(x); |
4 | if (i < 0) ret s; |
5 | ret substring(s, 0, i); |
6 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1004390 |
Snippet name: | dropFrom - drop rest of string from a certain substring (or leave unchanged if substring not found) |
Eternal ID of this version: | #1004390/1 |
Text MD5: | d49cb6af43c02588bb8771639da6ab44 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-08-15 15:11:06 |
Source code size: | 129 bytes / 6 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 605 / 600 |
Referenced in: | [show references] |