blockly > utils > parsing > tokenizeInterpolation

utils.parsing.tokenizeInterpolation() function

Parse a string with any number of interpolation tokens (%1, %2, ...). It will also replace string table references (e.g., %{bky_my_msg} and %{BKY_MY_MSG} will both be replaced with the value in Msg['MY_MSG']). Percentage sign characters '%' may be self-escaped (e.g., '%%'). Newline characters will also be output as string tokens containing a single newline character.

Signature:

export declare function tokenizeInterpolation(message: string): (string | number)[];

Parameters

Parameter Type Description
message string Text which might contain string table references and interpolation tokens.

Returns:

(string | number)[]

Array of strings and numbers.