Thanks for the reply! I do need to preserve 'str' so I guess I need:
let str = "SOME SEARCH TEXT"
var tmpStr = str
let letters = ["A","E","S"]
let replacements = ["a", "e", "s"]
letters.enumerated().forEach { (i,r) in
tmpStr = String(tmpStr.map {$0 == Character(String(r)) ? Character(String(replacements[i])) : $0});
print(tmpStr)
}
Post
Replies
Boosts
Views
Activity
LOL! I wish I was that young. I'm just playing around with Swift5 and Xcode 11 on a 10 year old iMac. If you know, when I access the "Help" menu in my app it gives out a boilerplate message that I'd like to replace (this is importing Cocoa and using the Storyboard for macOS).
(sorry for the late reply)
TIA,
SC