String

public extension String

String Extension.

  • Returns the Base64 encoded string

    Declaration

    Swift

    public func base64Encoded() -> String
  • Returns the Base64 decoded stirng for the current string. If cannot be decoded, return nil.

    Declaration

    Swift

    public func base64Decoded() -> String?
  • Returns the md5 hash of the string.

    Declaration

    Swift

    public func md5() -> String
  • Returns the SHA256 hash of the string.

    Declaration

    Swift

    public func sha256() -> String
  • If the string is a valid email address, returns the email address, otherwise, return nil.

    Declaration

    Swift

    public func validateAsEmail() -> String?
  • Parse JSON string to an array. Returns nil if cannot be parsed to an array.

    Declaration

    Swift

    public func toArray() -> [Any]?
  • Undocumented

    Declaration

    Swift

    func evaluate(againstRegex regex: String) -> Bool
  • Undocumented

    Declaration

    Swift

    func isEmailAddress() -> Bool
  • Undocumented

    Declaration

    Swift

    func isPhoneNumber() -> Bool
  • Undocumented

    Declaration

    Swift

    func containsUppercasechars() -> Bool
  • Undocumented

    Declaration

    Swift

    func containsLowercasechars() -> Bool
  • Undocumented

    Declaration

    Swift

    func containsNumbers() -> Bool
  • Undocumented

    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
  • Undocumented

    Declaration

    Swift

    func toJson() -> [String : Any]?