I want to replace some characters in my string and I run into this problem.
This is a sample string: "Chan is a beautiful woman."
I want to replace character "ch" with "C" only so my string will become "Can is a beautiful ...." However, when I type "ch" the text changes to "X". I know it is because of "kh" and "c" rules in my code but I need them in there. Do you have any suggestions?
let textContent = textView.text
var replace = textContent?.replacingOccurrences(of: "Gi", with: "Z")
replace = replace?.replacingOccurrences(of: "C" , with: "K")
replace = replace?.replacingOccurrences(of: "c" , with: "k")
replace = replace?.replacingOccurrences(of: "KH" , with: "X")
replace = replace?.replacingOccurrences(of: "Kh" , with: "X")
replace = replace?.replacingOccurrences(of: "kh" , with: "x")
replace = replace?.replacingOccurrences(of: "kH" , with: "x")
replace = replace?.replacingOccurrences(of: "Ch" , with: "C")
replace = replace?.replacingOccurrences(of: "CH" , with: "C")
replace = replace?.replacingOccurrences(of: "ch" , with: "c")
replace = replace?.replacingOccurrences(of: "cH" , with: "c")