Created
November 20, 2015 12:54
-
-
Save Jamonek/b5fb6f4a4da97999b6cd to your computer and use it in GitHub Desktop.
String extension to remove first character of a string in swift.
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 chomp : String { | |
mutating get { | |
self.removeAtIndex(self.startIndex) | |
return self | |
} | |
} | |
} | |
var test : String = "Chomp" | |
print(test.chomp) // homp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment