IME // Add expandingTildeInPath to String.

- Also removes the same section from StringUtils.
This commit is contained in:
ShikiSuen 2022-06-02 16:22:39 +08:00
parent 9977ef4846
commit b8ba683c9d
2 changed files with 9 additions and 6 deletions

View File

@ -63,10 +63,6 @@ extension String {
return string[..<string.index(string.startIndex, offsetBy: fixedIndex)].utf16.count
}
public var expandingTildeInPath: String {
(self as NSString).expandingTildeInPath
}
public func utf16SubString(with range: NSRange) -> String {
(self as NSString).substring(with: range)
}

View File

@ -355,9 +355,16 @@ extension RangeReplaceableCollection where Element: Hashable {
}
}
// MARK: - Error Extension
// MARK: - String Tildes Expansion Extension
extension String {
public var expandingTildeInPath: String {
(self as NSString).expandingTildeInPath
}
}
// MARK: - String Localized Error Extension
extension String: Error {}
extension String: LocalizedError {
public var errorDescription: String? {
self