Class: StringTransformer
String transformer transforms a string based on the given parameters.
If no parameters are given, the string will be returned as is. If an integer parameter is given, the string will be splitted into an array of strings using payload or space as a separator. And will return the element at the given index (integer parameter).
Use a +
before the index to reference every element up to and including the index value.
Use a +
after the index to reference the index value and every element after it.
Remarks
You need to use StrictVarsParser
parser to use this transformer.
Example
Implements
Constructors
new StringTransformer()
new StringTransformer(str
, escape
): StringTransformer
Parameters
• str: string
The string to transform.
• escape: boolean
= false
If true, the string will be escaped.
Returns
Defined in
Methods
transform()
transform(tag
): string
Transforms the given tag.
Parameters
• tag: Lexer
The tag that triggered the transformer.
Returns
string