What is the most efficient way to remove all the spaces, \\n and \\r in a String in Swift?
\\n
\\r
I have tried:
for character in s
Swift 4:
let string = "Test\n with an st\tri\rng" print(string.components(separatedBy: .whitespacesAndNewlines)) // Result: "Test with an string"