Created
May 7, 2021 16:51
-
-
Save fredriccliver/013657f25191896353447b19803be8a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
extension String { | |
var withoutPunctuations: String { | |
return self.components(separatedBy: CharacterSet.punctuationCharacters).joined(separator: "") | |
} | |
} | |
let originalStr:String = "hello, (Nice to- meet 한국 école %&$you all. 123 ! Давай العربية 😀" | |
print(originalStr) | |
print(originalStr.withoutPunctuations) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome solution!