Insert string after specific character

Hello. I’m trying to insert a string after this ‘&’ character.
For instance, if I have ‘Books & Shelves’, I need to add ‘amp;’ after the & which should be like this ‘Books & Shelves’. I already tried this variablename.Insert(7, “amp;”), however, the name can always be different, so I cannot use a static index #. How to do that no matter where the & is located?

Hi @private_matter ,

You can replace & with & in your string

"Books & Shelves".replace("&","&")

Regards,

Works perfectly thx!

1 Like

grafik

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.