This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Built-in Functions / Programming / String Manipulation  /
DigitQ

  • DigitQ[ string ] yields True if all the characters in the string are digits in the range 0 through 9, and yields False otherwise.
  • See the Mathematica book: Section 2.7.4.
  • See also: LetterQ, Number.

    Further Examples

    Since each of the characters in this string are digits, a value of True is returned

    In[1]:=

    Out[1]=

    This string contains a character that is not a digit.

    In[2]:=

    Out[2]=