I want to replace "a" with "an" in a sentence; e.g. "He has a egg in his bag", so that there'd be "an" before "egg".
I tried this:
let newString = "He has a egg in his bag".replacingOccurrences(of: "a", with: "an")
print(newString)
– but I get "he hans an egg in his bang" instead of getting "he has an egg in his bag".