- ⌂ Text
- Directives
#TEXT
Process and manipulate text.
Prototype
#TEXT($processor, $string, ...)
Parameters
- processor - How to process or manipulate the String.
- CRC32 - Return the CRC32 value of the string.
- DecodeBase64 - Decode Base 64 encoded text.
- DecodeHTMLEntities - Decode HTML entities like " to their string equivalent.
- DecodeQuotedPrintable - Decoded Quoted-Printable encoded text.
- DecodeURL - Decode a URL-encoded string.
- Ellipsize - Truncate long text, adding an ellipsis or other character where truncation occurs. For more information, see string_util::ellipsize(). Optional parameters are:
- max_length (default is 32)
- position (default 1) - Position within the string to truncate from, expressed as a number from 0 to 1 where 0 is the beginning of the string and 1 is the end.
- ellipsis (default "\xe2\x80\xa6") - Character or string to use where truncation occurs.
- Encode - Encode text with a specific character encoding. A few options are supported, which should be passed as the next parameter:
- 'ISO-8859-1'
- 'UTF8'
- 'Base64'
- EncodeBase64 - Base 64 encode text.
- EncodeHTMLEntities - Encode characters like quotes into HTML entities like ".
- EncodeQuotedPrintable - Encode a string as a Quoted-Printable string.
- EncodeURL - Encode a URL as a URL-encoded string.
- EscapeHTML - Encode a string for insertion into HTML, so that any special HTML codes and entities will display properly in a web browser.
- EscapecScript - Encode a string so that any special cScript code and variables will be escaped to produce their original form when interpreted in double-quotes within cScript.
- EscapeJavaScriptString - Encode a string so that any special JavaScript code and variables will be escaped to produce their original form when interpreted in double-quotes within JavaScript.
- EscapePHPString - Encode a string so that any special PHP code and variables will be escaped to produce their original form when interpreted in double-quotes within PHP.
- FirstUpper - Convert the first character to uppercase and everything else to lowercase.
- FormatNumber - Format a number with commas and a given precision (number of decimal places).
- FormatDuration - Format a number of seconds and a given precision (number of decimal places).
- FormatBytes - Format a number of bytes and a given precision (number of decimal places).
- IsPlural - Return TRUE if a word is in the plural form.
- IsSingular - Return TRUE if a word is in the singular form.
- Lower - Convert all letters to lowercase.
- NormalizeWhiteSpace - Remove leading/trailing white space and convert any contiguous white space into a single space
- Pluralize - Return the plural form of a singular word.
- Singularize - Return the singular form of a plural word.
- StripHTML - Remove HTML tags from text.
- Tab - Add one or more tabs to the beginning of each line of text.
- ToIdentifier - Remove characters not valid in an identifier. What remains will be a valid identifier, which can include capital and lowercase letters and numbers. HTML entities (ie. ®) are removed, accent characters normalized. See \io_comand_util\string_util\to_identifier() for details.
- Trim - Trim leading/trailing white space.
- Upper - Convert all letters to uppercase.
- string - The text to manipulate.
Return
Returns the manipulated text.
Example
#* tab multiple lines of text *#
#NEW($Text)
This is
multiple lines
of text
#ENDNEW
#TEXT(Tab,$Text,3)