Skip to content

Instantly share code, notes, and snippets.

@neauoire
Created October 8, 2015 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neauoire/cca901185b863b570cd2 to your computer and use it in GitHub Desktop.
Save neauoire/cca901185b863b570cd2 to your computer and use it in GitHub Desktop.
import Foundation
extension String
{
func subString(start: Int, length: Int) -> String
{
let range = Range<String.Index>(start: startIndex.advancedBy(start), end: startIndex.advancedBy(start + length))
return self.substringWithRange(range)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment