I'm trying to remove all the whitespaces from the NSNumberFormatter string. It seems it adds Unicode 160 as a whitespace instead of Unicode 32 and then String's stringByReplacingOccurrencesOfString doesn't work. Is this correct behavior and how should I remove the whitespaces?
let formatter = NSNumberFormatter()
formatter.locale = NSLocale(localeIdentifier: "fi")
formatter.numberStyle = .CurrencyStyle
formatter.currencyCode = "EUR"
formatter.currencySymbol = ""
let value = formatter.stringFromNumber(1234) ?? "" //"1 234,00 "
let trimmed = value.stringByReplacingOccurrencesOfString(" ", withString: "") // "1 234,00 "
let chars = value.utf16.map { $0 }
chars // [49, 160, 50, 51, 52, 44, 48, 48, 160]