Replacing brackets in a string

james3
Mon, 08 Aug 2022 13:59:48 +0000
New to Julia

I have a string such as str = "MyFunction[x] = ...", where x is a value. How do I replace the square brackets with parentheses such that str contains "MyFunction(x) = ..."? There can be may different values x, and in my string there can also be other brackets that I don’t wish to replace (so I don’t wish to replace all occurrences, which I know how to do). Thanks.

8 posts - 7 participants