Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Test if an expression corresponds to a valid symbol name
Test if a string is a valid symbol name:
In[1]:= |
![]() |
Out[1]= |
![]() |
In[2]:= |
![]() |
Out[2]= |
![]() |
Test a fully qualified name:
In[3]:= |
![]() |
Out[3]= |
![]() |
In[4]:= |
![]() |
Out[4]= |
![]() |
Non-string expressions cannot be symbol names:
In[5]:= |
![]() |
Out[5]= |
![]() |
Test a string corresponding to a nonexistent symbol:
In[6]:= |
![]() |
Out[6]= |
![]() |
In[7]:= |
![]() |
Out[7]= |
![]() |
PossibleNameQ only tests if the string corresponds to a valid symbol name:
In[8]:= |
![]() |
Out[8]= |
![]() |
It does not need to be an existing symbol:
In[9]:= |
![]() |
Out[9]= |
![]() |
PossibleNameQ only tests if it can be a symbol:
In[10]:= |
![]() |
Out[10]= |
![]() |
In[11]:= |
![]() |
Out[11]= |
![]() |
In[12]:= |
![]() |
Out[12]= |
![]() |
In[13]:= |
![]() |
Out[13]= |
![]() |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License