Created
July 24, 2017 16:31
-
-
Save JasonCanCode/32ec1e1bed528b679d1649c74a4f6708 to your computer and use it in GitHub Desktop.
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
extension String { | |
func removePrefix(_ prefixString: String) -> String { | |
guard self.hasPrefix(prefixString) else { | |
return self | |
} | |
let index = self.index(self.startIndex, offsetBy: prefixString.characters.count) | |
return self.substring(from: index) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment