Created
November 25, 2018 17:30
-
-
Save Hadevs/7ca11c3e7160a20fd03b8eb57172746d to your computer and use it in GitHub Desktop.
String delete all except numbers
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
extension String { | |
var onlyNumbers: String { | |
return components(separatedBy: .decimalDigits.inverted).joined() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment