String manipulation
lowerCase( )
Lower case all letters.
Examples
upperCase( )
Upper case all letters.
Examples
ucFirst( )
Upper case first letter.
Examples
ucWords( )
Upper case the first letter of all words.
Examples
print( message )
"catch all formatter"
always returns the same message if called
Parameters | Description | Type |
---|---|---|
message | text to print | string |
Examples
convEnum( type )
converts user-defined enums to human readable values
user-defined enums must be passed in
options
ofcarbone.render
Parameters | Description | Type |
---|---|---|
type | enum name passed in | string |
Examples
unaccent( )
Removes accents from text.
Examples
convCRLF( )
Renders carriage return \r
and line feed into documents instead of printing them as a string.
supported file formats:
DOCX
,PDF
,ODT
,ODS
ODS
support is experimental
use the
:convCRLF
formatter before:html
to convert to<br>
tagsexample:
{d.content:convCRLF:html}
Examples
substr( begin, end )
Slices a string with a begin and an end.
Parameters | Description | Type |
---|---|---|
begin | Zero-based index at which to begin extraction. | integer |
end | Zero-based index before which to end extraction | integer |
Examples
padl( targetLength, padString )
Pads the string from the start with another string.
Parameters | Description | Type |
---|---|---|
targetLength | The length of the resulting string once the string has been padded. If the value is less than string length, then string is returned as-is. | number |
padString | The string to pad the current str with. If padString is too long to stay within the targetLength, it will be truncated from the end. The default value is " " | string |
Examples
padr( targetLength, padString )
Pads the string from the end with another string.
Parameters | Description | Type |
---|---|---|
targetLength | The length of the resulting string once the string has been padded. If the value is less than string length, then string is returned as-is. | number |
padString | The string to pad the current str with. If padString is too long to stay within the targetLength, it will be truncated from the end. The default value is " " | string |
Examples
len( )
Returns the length of a string or array.
Examples
Last updated