Skip to content

Instantly share code, notes, and snippets.

@corteggo
Created September 25, 2018 18:46
Show Gist options
  • Select an option

  • Save corteggo/94dcdaecb35001cd05bcd49da01e904c to your computer and use it in GitHub Desktop.

Select an option

Save corteggo/94dcdaecb35001cd05bcd49da01e904c to your computer and use it in GitHub Desktop.
Remove last character of a String in Swift 4.2
let yourString: String = "Hello World"
let yourSubstring: String = yourString.dropLast()
print(yourSubstring) // Will print: "Hello Worl"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment