A template engine. A Parser instance can set template variable values, then parse a formatted string containing template variable placeholders to replace their values.
Constructors
Parser()
Initializes a new instance of the Parser class.
Methods
addVariable(String,String)
Adds a variable and its value to the parser.
Returns: CRMScript.Global.Void
evaluateString(String)
Parses a text and return the evaluated result from a RETURN statement inside the text.
Returns: CRMScript.Global.String - Any string set by a RETURN statement inside stringToParse.
getVariable(String,Integer)
Returns the value at the given index with the given name from the Parser instance.
Returns: CRMScript.Global.String - The value at the given index with the given name.
getVariableCount(String)
Returns the number of values for the given variable in the Parser instance.
Returns: CRMScript.Global.Integer - The number of values of the given variable.
parseString(String)
Parses a text and return the result.
Returns: CRMScript.Global.String - The parsed result.
setVariable(String,String)
Sets the variable with the given name to the given value in the Parser instance.
Returns: CRMScript.Global.Void
Existing values will be overwritten with this new value.
toParser(Parser)
Copies all values in the input parser to the original parser.
Returns: CRMScript.Global.Void