Mathematica > Core Language > String Manipulation > Character Operations > DigitQ >

DigitQ

DigitQ[string]
yields True if all the characters in the string are digits in the range 0 through 9, and yields False otherwise.
Test whether a character is a digit:
Test whether a character is a digit:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Test whether all characters in a string are digits:
Only ordinary digit characters are treated as digits:
New in 2
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF