Question : swift replace newlines with space
Answered by : annoying-angelfish-2ppawtnwy6t7
let myString = "This \n is a st\tri\rng"
let trimmedString = myString.components(separatedBy: .whitespacesAndNewlines).joined()
Source : https://stackoverflow.com/questions/34940044/how-to-remove-all-the-spaces-and-n-r-in-a-string/34940183 | Last Update : Thu, 29 Oct 20