Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Use functions meant for lists on strings
ResourceFunction["StringFunction"][f][string,…] applies f to the characters in string. |
Use a function meant for lists on a string:
In[1]:= | ![]() |
Out[1]= | ![]() |
Create new string functions from existing functions:
In[2]:= | ![]() |
Out[2]= | ![]() |
In[3]:= | ![]() |
Out[3]= | ![]() |
Rotate a string:
In[4]:= | ![]() |
Out[4]= | ![]() |
In[5]:= | ![]() |
Out[5]= | ![]() |
Get a random permutation of a string:
In[6]:= | ![]() |
Out[6]= | ![]() |
Replace all vowels:
In[7]:= | ![]() |
Out[7]= | ![]() |
Insert spaces between each letter:
In[8]:= | ![]() |
Out[8]= | ![]() |
More examples for StringFunction:
In[9]:= | ![]() |
Out[9]= | ![]() |
In[10]:= | ![]() |
Out[10]= | ![]() |
In[11]:= | ![]() |
Out[11]= | ![]() |
In[12]:= | ![]() |
Out[12]= | ![]() |
In[13]:= | ![]() |
Out[13]= | ![]() |
In[14]:= | ![]() |
Out[14]= | ![]() |
In[15]:= | ![]() |
Out[15]= | ![]() |
In[16]:= | ![]() |
Out[16]= | ![]() |
Functions created by StringFunction behave as though they were Listable:
In[17]:= | ![]() |
Out[17]= | ![]() |
In[18]:= | ![]() |
Out[18]= | ![]() |
This is similar to many of the built-in string functions:
In[19]:= | ![]() |
Out[19]= | ![]() |
Use a custom function in StringFunction:
In[20]:= | ![]() |
Out[18]= | ![]() |
In[21]:= | ![]() |
Out[21]= | ![]() |
If the given function produces nested lists of strings, the list structure will be preserved:
In[22]:= | ![]() |
Out[22]= | ![]() |
Characters are separated using Characters instead of byte values, so encoding is preserved:
In[23]:= | ![]() |
Out[23]= | ![]() |
The given function is applied to a list of strings:
In[24]:= | ![]() |
Out[24]= | ![]() |
In[25]:= | ![]() |
Out[25]= | ![]() |
StringFunction applies f to Characters["string"] and joins the result:
In[26]:= | ![]() |
Out[26]= | ![]() |
In[27]:= | ![]() |
Out[27]= | ![]() |
The given f must produce a string or lists of strings from its output:
In[28]:= | ![]() |
Out[28]= | ![]() |
In[29]:= | ![]() |
Out[29]= | ![]() |
Validity is not determined until evaluation of StringFunction[…][args]:
In[30]:= | ![]() |
Out[30]= | ![]() |
In[31]:= | ![]() |
Out[31]= | ![]() |
Create a scrolling marquee to experience that ‘90s website nostalgia:
In[32]:= | ![]() |
In[33]:= | ![]() |
Out[33]= | ![]() |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License