I want to replace a substring (e.g.
Convert your attributed string into an instance of
The mutable attributed string has a
mutableString property. According to the documentation:
"The receiver tracks changes to this string and keeps its attribute mappings up to date."
So you can use the resulting mutable string to execute the replacement with