June 19th, 2003, 04:08 PM
Replacing a char
I am trying t o replace just one char in a string. However, when I try to use the Replace function in the below context (newTimeStamp being 20-something characters long):
newTimeStamp = Replace(newTimeStamp, "5", " ",4,1)
It truncates my string by 8 characters!
For example, if newTimeStamp was ="123456789" then the result would be "4 6789"
Does anyone know why it is doing is this? And, just as importantly, how to get it not to?
I know I could Mid the first 3 digits and splice the two strings together, but I'd assume that there is a way to just replace the culprit char and save the rest of the string!
June 19th, 2003, 04:44 PM
What is happening is that when you tell it a start position, it returns a substring from this position on.
Unfortunately I do not know of a way around this except not to specify a start position.