sandwich(
PREFIX
,
ROOT
,
SUFFIX
)
The sandwich( function assembles a text item from three smaller items.
Parameters
This function has three parameters:
prefix – is the item of text that the final text will start with.
root – is the main character, word or phrase that you want to include in the final text. If the root is empty, the entire assembled text will be empty.
suffix – is the item of text that the final text will end with.
Description
The sandwich( function assembles a text item from three smaller text items. To do this, it slaps the prefix and suffix onto the ends of the root, just like a sandwich. However, if the root is empty, the prefix and suffix are also left off (the result is an empty text item), just as you wouldn’t make a sandwich without any meat.
sandwich("[[[","Welcome to the Future!","]]]") ☞ [[[Welcome to the Future!]]]
sandwich("[[[","","]]]") ☞
See Also
- ?( -- allows a formula to make a true/false, yes/no decision.
- batchreplace -- performs multiple find and replace operations on a piece of text.
- batchreplace( -- performs multiple find/replace operations on a piece of text.
- croptext( -- crops text to a specified length. If the text was already shorter than the specified length, it is left unchanged. If it is longer, the text is cut off and an ellipsis is added on the end.
- percentescape( -- encodes specified characters using percent encoding.
- percentunescape( -- decodes text that contains percent encoding.
- regexreplacefirst( -- replaces the first occurrence of a regular expression pattern with new text.
- regexreplacefirstexact( -- replaces the first occurrence of a regular expression pattern with new text.
- replace( -- replaces text with new text.
- replacefirst( -- replaces the first occurence of some text with new text.
- replacemultiple( -- replaces multiple words and phrases in a text value.
- strip( -- strips off leading and trailing blanks and other whitespace (carriage returns, tabs, etc.)
- stripchar( -- extracts characters you don't want from a text item.
- stripdiacriticals( -- strips diacritical marks from text.
- stripprintable( -- strips non-printable characters from text.
- striptoalpha( -- removes everything but alphabetic letters from a text item.
- striptonum( -- removes everything but numeric digits from a text item.
- urldecode( -- decodes text that contains percent encoded characters.
- urlencode( -- converts text into a legal URL (by converting spaces into `%20`). WARNING: THIS FUNCTION IS OBSOLETE.
- yoke( -- appends two text items together, with a joiner between them if both are non-blank.
History
10.0 | No Change | Carried over from Panorama 6.0 |