Home

isdigitlike

isdigitlike is a term used in text processing to describe a predicate that tests whether a string consists solely of digit characters drawn from any script.

Definition: In its conventional form, isdigitlike returns true if every character in the input has the Unicode

Examples: isdigitlike("123") -> true; isdigitlike("123") -> true; isdigitlike("123a") -> false; isdigitlike("") -> false.

Relation to other terms: It is related to isdigit and isnumeric. isdigitlike focuses on decimal digit characters;

Implementation notes: In most languages, a Unicode-aware approach iterates over code points and checks the Nd

Limitations: isdigitlike excludes numbers represented by numerals that are not digits, such as fractions or roman

property
Decimal
Digit
Number
(Nd).
The
string
must
be
non-empty
and
contain
only
digits;
whitespace,
signs,
decimal
separators,
or
letters
cause
a
false
result.
it
is
broader
than
ASCII-only
isdigit
but
narrower
than
isnumeric
in
some
definitions,
which
may
accept
other
numeric
characters
beyond
decimal
digits.
property.
Different
engines
may
provide
built-in
functions
such
as
isdigit
or
isnumeric;
behavior
for
empty
strings
and
surrogate
pairs
varies.
Use
cases
include
input
validation
for
internationalized
numeric
data.
numerals,
and
may
be
affected
by
normalization
and
invisible
characters.
It
is
most
effective
when
the
application
requires
strict
digit-only
input
across
multiple
writing
systems.