Created
July 29, 2023 13:25
-
-
Save foxicode/72bc8e9b6f39ea7d5b04af9f1b375cf3 to your computer and use it in GitHub Desktop.
Removing empty spaces in String (Swift)
This file contains hidden or 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
| public extension String { | |
| var trimmed: String { | |
| trimmingCharacters(in: CharacterSet.whitespacesAndNewlines) | |
| } | |
| func trim() -> String { | |
| trimmingCharacters(in: CharacterSet.whitespacesAndNewlines) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment