1
1
mirror of https://github.com/github/semantic.git synced 2024-11-30 06:07:23 +03:00
semantic/prototype/Doubt/String.swift

10 lines
310 B
Swift
Raw Normal View History

2015-07-18 22:43:49 +03:00
extension String {
func from(offset: String.Index.Distance) -> String {
2015-09-09 21:59:08 +03:00
return String(characters[startIndex.advancedBy(offset, limit: endIndex)..<endIndex])
2015-07-18 22:43:49 +03:00
}
func to(offset: String.Index.Distance) -> String {
2015-09-09 21:59:08 +03:00
return String(characters[startIndex..<startIndex.advancedBy(offset, limit: endIndex)])
2015-07-18 22:43:49 +03:00
}
}