I want to store float to CoreData and I want to convert every of the following inputs to 90.5:
- 90.5
- 90,5
- 90.5
- 90, 5
That means: Remove whitespace and convert , to .
Is this code best practice?
let str = " 90, 5 "
let converted = str.trimmingCharacters(in: .whitespacesAndNewlines)
let converted = strWithoutWithespace.replacingOccurrences(of: ",", with: ".")