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

9
LINES

< > BotCompany Repo | #1012263 // replacePartBetweenStrings

JavaX fragment (include)

1  
static S replacePartBetweenStrings(S s, S begin, S end, S replacement) {
2  
  if (s == null) null;
3  
  int i = indexOf(s, begin);
4  
  if (i < 0) ret s;
5  
  i += l(begin);
6  
  int j = indexOf(s, i, end);
7  
  if (j < 0) ret s;
8  
  ret substring(s, 0, i) + replacement + substring(s, j);
9  
}

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: #1012263
Snippet name: replacePartBetweenStrings
Eternal ID of this version: #1012263/1
Text MD5: 227ec5f7b93a873ebab378068702b9ac
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-26 19:21:21
Source code size: 279 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 489 / 514
Referenced in: [show references]