Multiple changes in StrSubst$()

Hi, I don’t find any option to define multiple substitutions of strings in a variable and I need help for it:

I have a text string and want to change not only 1 string with StrSubst$() but also 2 other in the same text.

So when I enter StrSubst$(Replacement1)+StrSubst$(Replacement2)+StrSubst$(Replacement3), it is writing the original three times with different replacements.
But I only want to print the text once with all 3 replacements combined.

I also checked StrSubst$(Replacement1, Replacement2,Replacement3), but then I get an error as only 1 replacement argumentation is allowed with it.

Current example:
StrSubst$(TabRedeemText,“Nummer:”) → deletes the string “Nummer:” out of the original
But it should replace as well “Datum:” by “Datum bis:” and “Haben Sie” by “Sie haben” in the same TabRedeemText

Can anybody give me a solution for it to define different string replacements in one single text?

Thanks in advance!

I tried now to combine with StrSubst$(StrSubst$(StrSubst$(Replacement1),Replacement2),Replacement3)
which works fine… but maybe there is a better solution or alternative… :smiley:

Hi Achim,

combining multiple StrSubst$ is a perfectly fine solution you came up with. There is no need to reinvent the wheel if it works :wink:

Have a nice day :slight_smile:

1 Like