String

struct String

Helpful String extensions.

  • Uses NSPredicate to evaluate the string against a regular expression. Returns true if successful.

    Declaration

    Swift

    func evaluate(againstRegex regex: String) -> Bool
  • Checks if the string is a valid email address.

    Declaration

    Swift

    func isEmailAddress() -> Bool
  • Checks if the string is a valid phone number.

    Declaration

    Swift

    func isPhoneNumber() -> Bool
  • Checks for uppercase case characters in the string.

    Declaration

    Swift

    func containsUppercasechars() -> Bool
  • Checks for lowercase characters in the string.

    Declaration

    Swift

    func containsLowercasechars() -> Bool
  • Checks if the string contains numeric characters.

    Declaration

    Swift

    func containsNumbers() -> Bool
  • Checks if the string contains atleast one of the characters from provided string.

    Declaration

    Swift

    func containsAtleastOneOfCharactersIn(_ characters: String) -> Bool
  • Makes sure self contains only the allowed symbols. in addition to other word charactors.

    Declaration

    Swift

    func onlyContainsAllowedSpecialCharactors(_ symbols: String) -> Bool