toString: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(add format, formattext)
m (template:command argument fix)
Line 11: Line 11:




|= Description
|DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


| '''toString''' array |= Syntax
| '''toString''' array |SYNTAX=


|p1= array: [[Array]] |= Parameter 1
|p1= array: [[Array]] |PARAMETER1=


| [[String]] |= Return value
| [[String]] |RETURNVALUE=
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code>[[hint]] [[toString]] [65,97,338];</code> returns "AaŒ"|= Example 1
|x1= <code>[[hint]] [[toString]] [65,97,338];</code> returns "AaŒ"|EXAMPLE1=
|x2= <code>["test","test"] [[joinString]] [[toString]] [12345] [[splitString]] [[toString]] [12345]; // ["test","test"]</code>|= Example 4
|x2= <code>["test","test"] [[joinString]] [[toString]] [12345] [[splitString]] [[toString]] [12345]; // ["test","test"]</code>|EXAMPLE4=
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[set]], [[resize]], [[reverse]], [[select]], [[in]], [[find]], [[toArray]], [[forEach]], [[count]], [[deleteAt]], [[deleteRange]], [[append]], [[sort]], [[param]], [[params]], [[arrayIntersect]], [[splitString]], [[joinString]], [[toLower]], [[toUpper]], [[toFixed]], [[endl]], [[format]], [[formatText]], [http://www.utf8-chartable.de/ Unicode Character Table] |= See also
| [[set]], [[resize]], [[reverse]], [[select]], [[in]], [[find]], [[toArray]], [[forEach]], [[count]], [[deleteAt]], [[deleteRange]], [[append]], [[sort]], [[param]], [[params]], [[arrayIntersect]], [[splitString]], [[joinString]], [[toLower]], [[toUpper]], [[toFixed]], [[endl]], [[format]], [[formatText]], [http://www.utf8-chartable.de/ Unicode Character Table] |SEEALSO=


}}
}}

Revision as of 15:50, 7 April 2019

-wrong parameter ("Arma") defined!-1.09
Hover & click on the images for description

Description

Description:
Converts the supplied Array of Numbers into a String.
The numbers in the array to be converted are the decimal Unicode representations of characters.
Groups:
Uncategorised

Syntax

Syntax:
toString array
Parameters:
array: Array
Return Value:
String

Examples

Example 1:
hint toString [65,97,338]; returns "AaŒ"
Example 2:
["test","test"] joinString toString [12345] splitString toString [12345]; // ["test","test"]

Additional Information

See also:
setresizereverseselectinfindtoArrayforEachcountdeleteAtdeleteRangeappendsortparamparamsarrayIntersectsplitStringjoinStringtoLowertoUppertoFixedendlformatformatTextUnicode Character Table

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Bottom Section

Posted on February 10, 2015 - 21:05 (UTC)
DreadedEntity
Tabs and new lines can be created with toString [9] and toString [10], respectively. Alternatively, a new line can also be created with toString [92,110] ("\n"). If you save these strings into a variable, they can be manipulated like any other string. For example, the following code will work just fine and return the expected output: _tab = toString [9]; for "_i" from 0 to 3 do { _tab = _tab + (toString [9]); }; copyToClipboard format ["x%1x",tab];
Posted on August 25, 2015 - 09:58 (UTC)
Killzone Kid
While you can convert any String to Array with toArray command, only numbers from 1 to 55295 (not 65535 as expected) can be successfully converted to String with toString and then back to Array with toArray without loss of data.