Xtension is a collection of native Swift extensions
"hello world".upperCamelCased
"hello world".lowerCamelCased
"hello world".lowerSnakeCased
"hello world".upperSnakeCased
"hello world".kebabCased
"hello world".validate(pattern: #"(\w)\s(\w)"#)
"hello world".validate(pattern: .alphabet)
"hello world".validate(pattern: .sentence)
"hello world".validate(pattern: .alphanumeric)
"[email protected]".validate(pattern: .email)
"http://www.example.com".validate(pattern: .url)
Add the following code to your Package.swift
:
dependencies: [
.package(url: "https://github.com/mhkashizadeh/Swift-Xtension.git", from: "0.1.5")
],
targets: {
.target(name: "YourTarget", dependencies: ["Swift-Xtension"])
}
Just import
import Xtension
Tests can be found here.
Run them with
swift test
link |
Stars: 0 |
Last commit: 1 year ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics