SeanutSwift/Sources/String.swift

15 lines
306 B
Swift
Raw Normal View History

2024-02-16 14:58:42 -05:00
// String.swift
import Foundation
extension String {
public var expandingTildeInPath: String {
return NSString(string: self).expandingTildeInPath
}
func toURL() -> URL? {
return hasPrefix("https://") ?
URL(string: self) : URL(string: "https://\(self)")
}
}