Function isDigit

  • Check that a string only consists of digits.

    Example

        isDigit("abcdefghijklmnopqrstuvxyz") // => false
    isDigit("ABCDEFGHIJKLMNOPQRSTUVXYZ") // => false
    isDigit("1234567890") // => true
    isDigit("=") // => false

    Returns

    True if it only contains alphanumeric characters.

    Parameters

    • string: string

      the string of characters

    Returns boolean