Skip to content

fdinc/Validator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Validator

Validate name, username, and email

Setup: How to add a Git repository to your Xcode project

Usage:

let string = " \n\t abc123  ".strip()  // => "abc123"
string.isAlphanumeric                  // => true
"j_s".isAlphanumeric                   // => false
let firstName = "John"
let lastName = "Smith"
let username = "johnsmith"
let email = "john.smith@example.com"

if !firstName.isValidName {
    print(Validator.invalidFirstNameMessage)
}

if !lastName.isValidName {
    print(Validator.invalidLastNameMessage)
}

if !username.isValidUsername {
    print(Validator.invalidUsernameMessage)
}

if !email.isValidEmail {
    print(Validator.invalidEmailMessage)
}

Released under the Unlicense.

About

Validate name, username, and email

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%