StringApply
StringApply[f,string]
applies f to the code points in string.
StringApply[f]
represents an operator form of StringApply that can be applied to an expression.
Details
![](Files/StringApply.en/details_1.png)
- StringApply[f,string] applies f to the code points in string, as returned by Characters.
- The function f should return a string or a list of strings when given a list of code points.
- If f returns a list, the output is joined into a single string.
- StringApply[f] is automatically threaded over lists, as if it had the Listable attribute.
Examples
open allclose allBasic Examples (5)
Scope (4)
Any function that operates on a list in its first argument may be used:
Functions created by StringApply behave as though they were Listable:
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 & Relations (2)
The given function is applied to a list of strings:
StringApply applies f to Characters["string"] and joins the result:
Possible Issues (2)
The given f must produce a string or lists of strings from its output:
![](Files/StringApply.en/1.gif)
Validity is not determined until evaluation of StringApply[…][args]:
![](Files/StringApply.en/2.gif)
Text
Wolfram Research (2024), StringApply, Wolfram Language function, https://reference.wolfram.com/language/ref/StringApply.html.
CMS
Wolfram Language. 2024. "StringApply." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/StringApply.html.
APA
Wolfram Language. (2024). StringApply. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/StringApply.html