Hello Guys,
Is there a way to execute a string.replace() on a given position of the string?
Let's say I have the string "FERNANDO" and want to replace the second "N" with "*" what would I do?
As far as I know, string.replace() replaces all occurrences of the substring, resulting "FER*A*DO" instead of "FERNA*DO".
Regards,
Fernando
Is there a way to execute a string.replace() on a given position of the string?
Let's say I have the string "FERNANDO" and want to replace the second "N" with "*" what would I do?
B4X:
dim wWord as string = "FERNANDO"
dim wNewWord as string = wWord.replace("N", "*")
log(wWord & " = " & wNewWord)
As far as I know, string.replace() replaces all occurrences of the substring, resulting "FER*A*DO" instead of "FERNA*DO".
Regards,
Fernando