Skip to main content

isAlpha

Callable

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

  • Check whether given str is alphabetic string.

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

    Example

    isAlpha("foobar")
    // => true

    isAlpha("foobar123")
    // => false

    isAlpha("foobar123", "123")
    // => true

    Parameters

    • str: string

      The string to check for alphabetic characters.

    • optionalextra: string

      Extra characters that are allowed.

    Returns boolean

    str consists of alphabetic characters.