Skip to content

Instantly share code, notes, and snippets.

@tkausch
Created October 23, 2020 15:10
Show Gist options
  • Save tkausch/3f96daced05a680156db20fbae0a028f to your computer and use it in GitHub Desktop.
Save tkausch/3f96daced05a680156db20fbae0a028f to your computer and use it in GitHub Desktop.
How to trim whitespace in a string
let str = " Taylor Swift is £!?"
let trimmed = str.trimmingCharacters(in: .whitespacesAndNewlines)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment