Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Replace parts of strings with expressions to create a row
ResourceFunction["StringReplaceRow"]["string",s→expr] gives a row wherein the string expression s is replaced by expr wherever it appears in "string". | |
ResourceFunction["StringReplaceRow"]["string",{s1→expr1,s2→expr2,…}] replaces the string expressions si by expri whenever they appear as substrings of "string". | |
ResourceFunction["StringReplaceRow"]["string",rules,n] does only the first n replacements. | |
ResourceFunction["StringReplaceRow"][{s1,s2,…},rules] gives the list of results for each of the si. | |
ResourceFunction["StringReplaceRow"][rules] represents an operator form of StringReplaceRules that can be applied to an expression. |
Style a word within a string:
| In[1]:= |
| Out[1]= |
Replace "image" with an image:
| In[2]:= |
| Out[2]= |
Use RuleDelayed to apply a function to the replaced string:
| In[3]:= |
| Out[3]= |
Replace parts of multiple strings to create a musical interface:
| In[4]:= | ![]() |
| Out[4]= | ![]() |
Replace multiple parts:
| In[5]:= | ![]() |
| Out[5]= |
Create an operator to fix branding on company materials:
| In[6]:= |
| Out[6]= |
Apply the operator to make sure your corporate messaging is perfect:
| In[7]:= |
| Out[7]= | ![]() |
Insert computable entities into text:
| In[8]:= |
| In[9]:= |
| Out[9]= |
Insert tooltips into text:
| In[10]:= | ![]() |
| Out[10]= |
Create a function to help choose synonyms while writing:
| In[11]:= | ![]() |
| In[12]:= |
| Out[12]= |
When replacements are made, the result is a Row:
| In[13]:= |
| Out[13]= |
When no matches exist, the original string is returned:
| In[14]:= |
| Out[14]= |
For results longer than the window size, the output is likely to wrap at the replacements:
| In[15]:= |
| Out[15]= | ![]() |
Any part of a string can be bird said:
| In[16]:= |
| Out[16]= | ![]() |
Words can also be bobbed:
| In[17]:= |
| Out[17]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License