Skip to content

Commit

Permalink
Removed unused String extensions methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksandr Orlov committed Jan 16, 2021
1 parent 1405e2e commit a8973d5
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions Source/Extensions/String+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ extension String {
return self[self.index(self.startIndex, offsetBy: index)]
}

func slice(from: String, toString: String) -> String? {
return (range(of: from)?.upperBound).flatMap { substringFrom in
(range(of: toString, range: substringFrom..<endIndex)?.lowerBound).map { substringTo in
String(self[substringFrom..<substringTo])
}
}
}

func sliceAfter(substring: String) -> String {
guard self.contains(substring) else { return self }
guard count > substring.count else { return "" }
Expand Down Expand Up @@ -65,12 +57,6 @@ extension String {
return String(self[self.startIndex..<end])
}

func leftSliceIncluding(end: String.Index) -> String {
guard !self.isEmpty else { return self }
guard self.startIndex != end else { return String(self[self.startIndex..<end]) }
return String(self[self.startIndex...end])
}

func slice(in range: Range<String.Index>) -> String {
return String(self[range])
}
Expand Down

0 comments on commit a8973d5

Please sign in to comment.