Description
Converts the supplied Array of Numbers into a String through https://en.wikipedia.org/wiki/Unicode characters representation conversion, or provided Code to compilable String.
Syntax
Syntax 1
toString array
Parameters:
-
array: Array of Numbers
Important
If array contains non-number values, the following error might appear in .rpt file: Bad conversion: scalar. See parseSimpleArray for multi-type array.
Returns: String - https://en.wikipedia.org/wiki/Unicode numbers converted to String of characters
Syntax 2
since arma3 2.02
toString code
Parameters:
Returns: String - compilable String from provided code
Examples
Example 1
hint toString [65,97,338];
Example 2
["test", "test"] joinString toString [12345] splitString toString [12345];
Example 3
private _compilableString = toString { hint "it works!" };
hint _compilableString;
sleep 2;
call compile _compilableString;
See also
parseSimpleArray · set · resize · reverse · select · in · find · toArray · forEach · count · deleteAt · deleteRange · append · sort · param · params · arrayIntersect · splitString · joinString · toLower · toUpper · toFixed · endl · format · formatText · toLowerANSI · toUpperANSI
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];
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.