blockly > Block > toString
Block.toString() method
Create a human-readable text representation of this block and any children.
Signature:
toString(opt_maxLength?: number, opt_emptyToken?: string): string;
Parameters
Parameter |
Type |
Description |
opt_maxLength |
number |
(Optional) Truncate the string to this length. |
opt_emptyToken |
string |
(Optional) The placeholder string used to denote an empty input. If not specified, '?' is used. |
Returns:
string
Text of block.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `toString()` method generates a human-readable text representation of a block and its children."],["This method accepts optional parameters to limit the string length (`opt_maxLength`) and customize the placeholder for empty inputs (`opt_emptyToken`)."],["The output of the `toString()` method is a string containing the textual representation of the block."]]],[]]