Swift Replace Newlines With Space

[Solved] Swift Replace Newlines With Space | Swift - Code Explorer | yomemimo.com
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

Answers related to swift replace newlines with space

Code Explorer Popular Question For Swift