blockly > Block > setCommentText
Set this block's comment text.
Signature:
setCommentText(text: string | null): void;
Parameters
Parameter |
Type |
Description |
text |
string | null |
The text, or null to delete. |
Returns:
void
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 `setCommentText()` method allows you to modify or remove the comment associated with a specific block."],["It accepts a single parameter, `text`, which can be a string containing the new comment or `null` to delete the existing comment."],["Calling this method updates the block's comment without returning any value."]]],["The `setCommentText()` method, part of the `Block` class, sets a block's comment text. It accepts a single parameter, `text`, which can be a string or `null`. Providing a string value sets the comment text, while `null` deletes any existing comment. The method returns `void`, indicating it doesn't return any value.\n"]]