Quantcast
Viewing all articles
Browse latest Browse all 8

Answer by Rodolfo Teixeira for How to remove special characters from string in Swift 2?

without removing spaces between words

extension String {    var removeSpecialCharacters: String {        return self.components(separatedBy: CharacterSet.alphanumerics.inverted).filter({ !$0.isEmpty }).joined(separator: " ")    }}

Viewing all articles
Browse latest Browse all 8

Trending Articles