string (function): Difference between revisions
Jump to navigation
Jump to search
(Added this page as disambiguation of "string" (type vs. func)) |
(Added this page as disambiguation of "string" (type vs. func)) |
(No difference)
|
Latest revision as of 23:59, 23 November 2023
string() Function
• Introduced in version 1.3b48
Returns the string value that is passed in as another data type. When passed a string, no change is made. When a number is passed, it is returned as a string in its minimal representation (meaning as few characters as possible to produce an accurate value, ie. no leading zeroes or spaces and no plus sign for positive numbers). When passed a JSON Object or JSON Array, the JSON will be converted to a string and returned without any formatting (no embedded newlines or whitespace).
If you're looking for the
When formatting of the numeric value is required (such as leading spaces or zeroes, a forced plus/minus sign, a specific number of digits, and so on), use strformat() instead.string
data type, see Category:Variable Type.Usage
string(val)