Hello,
This issue may have been addressed before, however I did not find a solution.
I want to use the replace function, although in my case it is working a little too well. In a string, I have several similar occurences to replace, although I want to replace using an exact match, not anything similar to it. Here's and example:
How can I change the string for an exact match and not affect the remaining string? Please also note that the matching string could be in any location in the string (either before a like match or even after a like match).
Any help would be appreciated.
If at first you don't succeed, then sky diving wasn't meant for you!
This issue may have been addressed before, however I did not find a solution.
I want to use the replace function, although in my case it is working a little too well. In a string, I have several similar occurences to replace, although I want to replace using an exact match, not anything similar to it. Here's and example:
Code:
Dim strTest as string
strTest = "0593, 05930-A, 05930-B"
strTest = Replace$(strTest, "0593", "")
'Expected result:
'strTest = ", 05930-A, 05930-B"
'Actual result:
'strTest = ", 0-A, 0-B"
How can I change the string for an exact match and not affect the remaining string? Please also note that the matching string could be in any location in the string (either before a like match or even after a like match).
Any help would be appreciated.
If at first you don't succeed, then sky diving wasn't meant for you!