StringFunction
Contributed by:
Richard Hennigan (Wolfram Research)
Examples
Basic Examples
Use a function meant for lists on a string:
Create new string functions from existing functions:
Rotate a string:
Get a random permutation of a string:
Replace all vowels:
Insert spaces between each letter:
And many more:
Scope
Functions created by StringFunction behave as though they were Listable:
This is similar to many of the built-in string functions:
Use a custom function in StringFunction:
If the given function produces nested lists of strings, the list structure will be preserved:
Characters are separated using Characters instead of byte values, so encoding is preserved:
Properties and Relations
The given function is applied to a list of strings:
StringFunction applies f to Characters[string] and joins the result:
Possible Issues
The given f must produce a string or lists of strings from its output:
Validity isn’t determined until evaluation of StringFunction[…][args]:
Neat Examples
Create a scrolling marquee to experience that 90’s website nostalgia:
Resource History