diff --git a/Sources/Arimaxtension/Extensions/String/ToURL.swift b/Sources/Arimaxtension/Extensions/String/ToURL.swift new file mode 100644 index 0000000..d44bf78 --- /dev/null +++ b/Sources/Arimaxtension/Extensions/String/ToURL.swift @@ -0,0 +1,18 @@ +// +// File.swift +// +// +// Created by Taichi Arima on 2021/11/07. +// + +import Foundation + + +public extension String { + + // Usage: let url = "https://www.apple.com/".url! + // from: https://qiita.com/tattn/items/ff50e575bc149ecb8e80 + var url: URL? { + URL(string: self) + } +}