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

7
LINES

< > BotCompany Repo | #1002784 // deleteFromTo - delete a part of a string

JavaX fragment (include)

1  
static S deleteFromTo(S s, S from, S to) {
2  
  int i = s.indexOf(from);
3  
  if (i < 0) ret s;
4  
  int j = s.indexOf(to, i+l(from));
5  
  if (j < 0) ret s;
6  
  ret s.substring(0, i) + s.substring(j+l(to));
7  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1002784
Snippet name: deleteFromTo - delete a part of a string
Eternal ID of this version: #1002784/1
Text MD5: 21ca263ec126d1b18815baf71c0cabf2
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-02-24 01:22:41
Source code size: 201 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 674 / 679
Referenced in: [show references]