Skip to content

Instantly share code, notes, and snippets.

@mono0926
Created October 1, 2016 01:44
Show Gist options
  • Save mono0926/ce5664c06369ce71a72e540e7b0632e0 to your computer and use it in GitHub Desktop.
Save mono0926/ce5664c06369ce71a72e540e7b0632e0 to your computer and use it in GitHub Desktop.
extension String: BidirectionalCollection, RangeReplaceableCollection {}
extension String {
public mutating func removeFirst(_ n: Int) {
characters.removeFirst(n)
}
public mutating func removeLast(_ n: Int) {
characters.removeLast(n)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment