Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Replace all substring in string
function ReplaceStrInSubstrs(inputString,phr,newstr) local str = inputString local r = "" local roll = true if string.find(str,phr) then while roll do local a = string.find(str,phr) local b = a + #phr for i = 1,#str do if i >= a and i < b then r = r..newstr else r = r..str:sub(i,i) end end str = r r = "" if not string.find(str,phr) then roll = false end end end return str end print (ReplaceStrInSubstrs("Hello &World& Fuck &the& day","&","%"))
run
|
edit
|
history
|
help
0
The Pyramid in the two-dimensional array made of random stones - Lua
Key
test123
ShSlotMachine_Data
ok
Random Item Generator (1 year)
PAID HACK PuBG
kraft1c
test
missing element