//
//  Extensions.swift
//  
//
//  Created by Anton Heestand on 2021-01-03.
//

import Foundation

//extension StringProtocol {
//    subscript(offset: Int) -> Character { self[index(startIndex, offsetBy: offset)] }
//    subscript(range: Range<Int>) -> SubSequence {
//        let startIndex = index(self.startIndex, offsetBy: range.lowerBound)
//        return self[startIndex..<index(startIndex, offsetBy: range.count)]
//    }
//    subscript(range: ClosedRange<Int>) -> SubSequence {
//        let startIndex = index(self.startIndex, offsetBy: range.lowerBound)
//        return self[startIndex..<index(startIndex, offsetBy: range.count)]
//    }
//    subscript(range: PartialRangeFrom<Int>) -> SubSequence { self[index(startIndex, offsetBy: range.lowerBound)...] }
//    subscript(range: PartialRangeThrough<Int>) -> SubSequence { self[...index(startIndex, offsetBy: range.upperBound)] }
//    subscript(range: PartialRangeUpTo<Int>) -> SubSequence { self[..<index(startIndex, offsetBy: range.upperBound)] }
//}
//
//extension String {
//    subscript (bounds: CountableClosedRange<Int>) -> String {
//        let start = index(startIndex, offsetBy: bounds.lowerBound)
//        let end = index(startIndex, offsetBy: bounds.upperBound)
//        return String(self[start...end])
//    }
//
//    subscript (bounds: CountableRange<Int>) -> String {
//        let start = index(startIndex, offsetBy: bounds.lowerBound)
//        let end = index(startIndex, offsetBy: bounds.upperBound)
//        return String(self[start..<end])
//    }
//}
