Hello,
I want to replace the string
xxx"100%"xxx
by
xxx"25%"xxx
I tried
if buf == "xxx"100%"xxx" THEN buf = "xxx"25%"xxx"
if buf == ""xxx"100%%"xxx"" THEN buf = ""xxx"25%%"xxx""
if buf == """xxx"100%%"xxx""" THEN buf = """xxx"25%%"xxx"""
if buf == """"xxx"100%%"xxx"""" THEN buf = """"xxx"25%%"xxx""""
all is wrong! Any idea?
Regards,
Erhard
You are close but
buf = "xxx""100%%""xxx"
if buf == "xxx""100%%""xxx" THEN buf = "xxx""25%%""xxx"
is likely what you want. You can also do something like this:
buf = 'xxx"100%%"xxx'
if buf == 'xxx"100%%"xxx' THEN buf = 'xxx"25%%"xxx'
which many may find more readable.
You can also use the StrReplace function, if you can make a few assumptions about your strings:
buf = 'xxx"100%%"xxx'
buf=StrReplace(buf,"100%%", "25%%")
YEPP! That works!
Many thanks, 99 pts for you.
- close -