調査アンケート: Blockly のご利用体験についてお聞かせください
アンケートを開始
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
ブロックする >utils >解析 >tokenizeInterpolation
utils.parsing.tokenizeInterpolation() 関数
任意の数の補間トークン(%1、%2、...)を含む文字列を解析します。また、文字列テーブル参照(%{bky_my_msg} と %{BKY_MY_MSG} はどちらも Msg['MY_MSG'] の値に置き換えられます。パーセント記号「%」自動的にエスケープされます(例:「%%」)。改行文字も、1 つの改行文字を含む文字列トークンとして出力されます。
署名:
export declare function tokenizeInterpolation(message: string): (string | number)[];
パラメータ
パラメータ |
型 |
説明 |
メッセージ |
文字列 |
文字列テーブル参照と補間トークンを含む可能性のあるテキスト。 |
戻り値:
(文字列 | 数値)[]
文字列と数値の配列。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-08-22 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2024-08-22 UTC。"],[[["`utils.parsing.tokenizeInterpolation` parses a string, identifying interpolation tokens (%1, %2, etc.), string table references (%{bky_my_msg}), and escaped percentage signs (%%), returning an array of strings and numbers."],["It handles string table references by replacing them with their corresponding values from the `Msg` object, allowing for dynamic text insertion."],["The function also treats newline characters as individual string tokens to preserve formatting in the output."]]],[]]