Last active
February 18, 2017 13:18
-
-
Save kristopherjohnson/f8332d7e6b7ce7604970af5f030ab616 to your computer and use it in GitHub Desktop.
Swift 3: Get a substring starting from a given numeric index to the end of the string.
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 { | |
/// Returns substring starting from given numeric index to the end of the string. | |
func substring(fromNumericIndex numericIndex: Int) -> String { | |
return self.substring(from: self.index(self.startIndex, offsetBy: numericIndex)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment