toArray

From Bohemia Interactive Community
Revision as of 14:39, 16 April 2021 by R3vo (talk | contribs) (alt syntax)
Jump to navigation Jump to search
Hover & click on the images for description

Description

Description:
Converts the supplied String into an Array of Numbers. The numbers in the created array are the decimal Unicode representations of characters. Template:Featuer
Groups:
StringsArrays

Syntax 1

Syntax:
toArray string
Parameters:
string: String
Return Value:
Array

Syntax 2

Syntax:
toArray hashMap Template:Since
Parameters:
hashMap: HashMap
Return Value:
Array - Array in format [[key, key, ...], [value, value, ...]]

Syntax 3

Syntax:
hashMap toArray method Template:Since
Parameters:
hashMap: HashMap
method: Boolean - See return value
Return Value:
Array - Array in either one of the following formats:
  • method: true - [[key1, key2, ...], [value1, value2, ...]]
  • method: false - [[key1, value1], [key2, value2], ...] This is very inefficient since the engine has to create many small arrays

Examples

Example 1:
hint format ["%1", toArray "AaŒ"];// Returns "[65,97,338]"

Additional Information

See also:
setresizereverseselectinfindtoStringcountdeleteAtsplitStringjoinStringtoUpperANSIUnicode 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