Advanced string replace()
Posted: 30 Dec 2014 08:39
Hello Martin,
I would like to replace part of string at a given index position. Existing replace() and replaceAll() replaces everything that match search string.
Is there a way to realize something like:
string myreplace(string ori, num startidx, num lenght, string replace)
startidx=position at which one starts to replace
length=number of indices to be replaced
For example:
myreplace("haha", 1, 3,"ello")
It will return "hello"
Regards
Andy
I would like to replace part of string at a given index position. Existing replace() and replaceAll() replaces everything that match search string.
Is there a way to realize something like:
string myreplace(string ori, num startidx, num lenght, string replace)
startidx=position at which one starts to replace
length=number of indices to be replaced
For example:
myreplace("haha", 1, 3,"ello")
It will return "hello"
Regards
Andy