Question : swift remove space from string
Answered by : adventurous-anteater
let freedSpaceString = str.filter {!$0.isWhitespace}
Source : | Last Update : Wed, 19 Feb 20
Question : how to get rid of excess space in swift
Answered by : encouraging-eland-ol9hnz3fcuoq
let str = " Taylor Swift "
let trimmed = str.trimmingCharacters(in: .whitespacesAndNewlines) // prints "Taylor Swift"
Source : https://www.hackingwithswift.com/example-code/strings/how-to-trim-whitespace-in-a-string | Last Update : Sat, 06 Jun 20