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

4
LINES

< > BotCompany Repo | #1007915 // replacePrefix - replace string prefix if there

JavaX fragment (include)

static S replacePrefix(S prefix, S replacement, S s) {
  if (!startsWith(s, prefix)) ret s;
  ret replacement + substring(s, l(prefix));
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1007915
Snippet name: replacePrefix - replace string prefix if there
Eternal ID of this version: #1007915/2
Text MD5: e9d92afeb84d8f070ef5b4aa540d4736
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-04-17 14:13:34
Source code size: 141 bytes / 4 lines
Pitched / IR pitched: No / No
Views / Downloads: 580 / 1232
Version history: 1 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1027196 - replacePrefixIC - replace string prefix if there
#1033356 - replacePrefixes