Replace One Instance of String or Char Range
Posted: Mon Mar 08, 2010 9:37 pm
Hello all,
I wish to be able replace a range of chars (eg char 3 to 5) in a string with another string (say 7).
So something like "Linda closed the door" becomes "Li7 closed the door".
If you use something like it takes the char at position three not the position.
Alternatively is there a way to use replace whereby it only changes the first instance of the found string?
Any assistance, most appreciated.
Kind regards, Andrew
I wish to be able replace a range of chars (eg char 3 to 5) in a string with another string (say 7).
So something like "Linda closed the door" becomes "Li7 closed the door".
If you use something like
Code: Select all
replace char 3 with theCounter in theHaystack
Alternatively is there a way to use replace whereby it only changes the first instance of the found string?
Any assistance, most appreciated.
Kind regards, Andrew