I have a string:
I want to always change C to C=Potato. No matter what already is there (wont always be Tomato).Code:myString = "A=Bob, B=Cat, C=Tomato, and the crowd goes wild"
In VB6 I did this:
Which worked fine, but I wondered if there was a better way for VB2005Code:start = InStr(1, UCase(myString), UCase("C=")) + Len("C=") pos_end = InStr(start + 1, myString, ",") NewString = Mid(myString, 1, start) & "Potato" & Mid(myString, pos_end)




Reply With Quote