Skip to main content

isAlphaNumeric

Callable

  • isAlphaNumeric(str: string, extra?: string): boolean

  • Check whether given str is alphanumeric string.

    The allowed characters are A-Z, and a-z.

    Example

    isAlphaNumeric("foobar")
    // => true

    isAlphaNumeric("foobar123")
    // => true

    isAlphaNumeric("foobar")
    // => false

    isAlphaNumeric("foobar$", "$")
    // => true

    Parameters

    • str: string

      The string to check for alphanumeric characters.

    • optionalextra: string

      Extra characters that are allowed.

    Returns boolean

    str consists of alphanumeric characters.