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

7
LINES

< > BotCompany Repo | #1024383 // spliceString - take out part and put in something new. note: second int is TO, not LENGTH

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (73L/1K).

sS spliceString(S a, int from, int to, S b) {
  ret substring(a, 0, from) + b + substring(a, Math.max(from, to));
}

sS spliceString(S a, int from, int to, char b) {
  ret spliceString(a, from, to, str(b));
}

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1024383
Snippet name: spliceString - take out part and put in something new. note: second int is TO, not LENGTH
Eternal ID of this version: #1024383/6
Text MD5: f8049f2c775322d8a090bfa39451b4af
Transpilation MD5: 10bac1c5abeba93b0a393c00e239d505
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-05-06 16:10:38
Source code size: 214 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 302 / 374
Version history: 5 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1025267 - insertString
#1026315 - spliceList - take out part and put in something new. note: second int is TO, not LENGTH
#1031114 - replaceOneCharInString