insert: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " \| *(game[0-9]|version[0-9]|gr[0-9]|serverExec|mp|pr|descr|s[0-9]|p[0-9]{1,3}|r[0-9]|x1?[0-9]|seealso) *= +" to " |$1= ") |
Lou Montana (talk | contribs) |
||
Line 21: | Line 21: | ||
|p3= [value1, value2, ...]: [[Array]] of [[Anything]] - Values to insert at the specified index | |p3= [value1, value2, ...]: [[Array]] of [[Anything]] - Values to insert at the specified index | ||
|p4= onlyIfUnique: [[ | |p4= onlyIfUnique: [[Boolean]] - Only insert if the value is unique in the array, like [[pushBackUnique]] | ||
|r1= [[Nothing]] | |r1= [[Nothing]] |
Revision as of 22:00, 10 August 2021
Description
- Description:
- Inserts multiple values into Array/String/HashMap.
The String variant also supports forceUnicode. - Groups:
- HashMapArraysStrings
Syntax 1
- Syntax:
- array insert [index, [value1, value2, ...], onlyIfUnique]
- Parameters:
- array : Array
- index: Number - index at which the values will be inserted, -1 for append.
- [value1, value2, ...]: Array of Anything - Values to insert at the specified index
- onlyIfUnique: Boolean - Only insert if the value is unique in the array, like pushBackUnique
- Return Value:
- Nothing
Syntax 2
- Syntax:
- string insert [index, substring]
- Parameters:
- string : String
- index: Number - index at which the values will be inserted, -1 for append.
- substring: String - String to insert
- Return Value:
- String - The new string
Syntax 3
- Syntax:
- hashMap insert [[key1, value1], [key2, value2], ...] Template:Since
- Parameters:
- hashMap: HashMap
- key: HashMapKey
- value: Anything
- Return Value:
- Nothing
Syntax 4
- Syntax:
- hashMap insert [splitArray, [KeysAndValues]] Template:Since
- Parameters:
- hashMap: HashMap
- splitArray: Boolean - See KeysAndValues
- KeysAndValues: Array
- Return Value:
- Nothing
Examples
- Example 1:
"Test" insert [0, "Radio"]; // Returns "RadioTest"
Additional Information
- See also:
- HashMap
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