Skip to content

Commit 2105084

Browse files
committed
Remove some String additions
1 parent a49ef53 commit 2105084

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

FazeKit/Classes/StringAdditions.swift

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)