// for str.trimmingCharacters() import Foundation // string.trim() extension String { func trim() -> String { trimmingCharacters(in: .whitespacesAndNewlines) } }
Foundation โฉ NSString โฉ .trimmingCharacters(in:)
Does swift have a trim method on String?
Last updated 2 years ago