Warning: session_start(): open(/var/lib/php/sessions/sess_nofq1vg0oit2t3bofvdbds658o, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51

Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
dropFrom - drop rest of string from a certain substring (or leave unchanged if substring not found) [1004390]

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)

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