isHexadecimal function

bool isHexadecimal(
  1. String str
)

Checks if the string is a hexadecimal number.

Accepts an optional 0x or 0h prefix followed by one or more hexadecimal digits.

Example:

isHexadecimal('deadBEEF'); // true
isHexadecimal('0xff'); // true
isHexadecimal('xyz'); // false

Implementation

bool isHexadecimal(String str) => _isHexadecimal(str);