I have a string "This is a symbol U+0202 and so is this U+023B" that I want to replace every occurrence of the string pattern "U+XXXX" with \u{XXXX}. For example, an extension to String that does that:
extension String {
var withConvertedUnicodeSymbols : String { ... }
}
Example:
var string0 = "This is a symbol U+0202 and so is this U+023B"
var string1 = string0.withConvertedUnicodeSymbols
// string1 = "This is a symbol \u{0202} and so is this \u{023B}"
print(string1)
// prints: This is a symbol Ȃ and so is this Ȼ