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

6
LINES

< > BotCompany Repo | #1004390 // dropFrom - drop rest of string from a certain substring (or leave unchanged if substring not found)

JavaX fragment (include)

static S dropFrom(S s, S x) {
  if (s == null) null;
  int i = s.indexOf(x);
  if (i < 0) ret s;
  ret substring(s, 0, i);
}

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: 603 / 598
Referenced in: [show references]