File tree Expand file tree Collapse file tree 1 file changed +0
-15
lines changed
Expand file tree Collapse file tree 1 file changed +0
-15
lines changed Original file line number Diff line number Diff line change @@ -40,21 +40,6 @@ public extension String {
4040 return self [ self . characters. index ( self . startIndex, offsetBy: i) ]
4141 }
4242
43- public subscript( r: Range < Int > ) -> String {
44- let startIndex = self . characters. index ( self . startIndex, offsetBy: max ( 0 , r. lowerBound) )
45- let endIndex = self . characters. index ( self . startIndex, offsetBy: min ( self . count, r. upperBound) )
46- return String ( self [ startIndex..< endIndex] )
47- }
48-
49- public func rangeFromNSRange( _ nsRange: NSRange ) -> Range < String . Index > ? {
50- let from16 = utf16. index ( utf16. startIndex, offsetBy: nsRange. location, limitedBy: utf16. endIndex) ?? utf16. endIndex
51- let to16 = utf16. index ( from16, offsetBy: nsRange. length, limitedBy: utf16. endIndex) ?? utf16. endIndex
52- if let from = String . Index ( from16, within: self ) ,
53- let to = String . Index ( to16, within: self ) {
54- return from ..< to
55- }
56- return nil
57- }
5843
5944 public func substring( _ startIndex: Int , length: Int ) -> String {
6045 let start = self . characters. index ( self . startIndex, offsetBy: startIndex)
You can’t perform that action at this time.
0 commit comments