Skip to content

Instantly share code, notes, and snippets.

@kristopherjohnson
Last active February 18, 2017 13:18
Show Gist options
  • Save kristopherjohnson/f8332d7e6b7ce7604970af5f030ab616 to your computer and use it in GitHub Desktop.
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.
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