Stay organized with collections
Save and categorize content based on your preferences.
blockly > Field > getText
Field.getText() method
Get the text from this field. Override getText_ to provide a different behavior than simply casting the value to a string.
Signature:
/** @sealed */
getText(): string;
Returns:
string
Current text.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["\u003cp\u003e\u003ccode\u003eField.getText()\u003c/code\u003e retrieves the textual representation of a field's value.\u003c/p\u003e\n"],["\u003cp\u003eOverriding the \u003ccode\u003egetText_\u003c/code\u003e method allows for custom text formatting beyond basic string conversion.\u003c/p\u003e\n"],["\u003cp\u003eThe method returns the current text content of the field as a string.\u003c/p\u003e\n"]]],[],null,[]]