Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > Expressions > Testing Expressions >
Mathematica > Core Language > Procedural Programming > Conditionals > Testing Expressions >

StringQ

StringQ[expr]
gives True if expr is a string, and False otherwise.
Test whether "123" is a string:
Pick out all strings in a list:
Test whether "123" is a string:
In[1]:=
Click for copyable input
Out[1]=
 
Pick out all strings in a list:
In[1]:=
Click for copyable input
Out[1]=
Strings works on strings with internal formatting:
Strings works on any sequence of ordinary and special characters:
All strings have head String:
Use ToString to convert an expression to a string:
Use StringMatchQ to test whether a string pattern match a particular string:
New in 2
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team