blockly > utils > parsing > tokenizeInterpolation

utils.parsing.tokenizeInterpoation() 函式

以任意數量的內插符記剖析字串 (%1、%2、...)。此外,字串表參照 (例如%{bky_my_msg} 和 %{BKY_MY_MSG} 將替換成 Msg['MY_MSG'] 中的值。百分比符號「%」可能會自行逸出 (例如「%%」)。換行字元也會輸出為含有單一換行字元的字串符記。

Signature:

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

參數

參數 類型 說明
訊息 字串 文字可能包含字串資料表參照和內插符記。

傳回:

(字串 | 數字)[]

字串和數字的陣列。