Skip to content

acani/Validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 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
"0123".isNumeric                       // => true
"1E3".isNumeric                        // => false
let firstName = "John"
let lastName = "Smith"
let username = "johnsmith"
let email = "john.smith@example.com"
let code = "1234"

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

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

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

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

if !code.isValidCode {
  print(Validator.invalidCodeMessage)
}

Released under the Unlicense.

About

Validate name, username, and email

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages