insert: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Some wiki formatting) |
Lou Montana (talk | contribs) m (Text replacement - "{{HashLink" to "{{Link") |
||
Line 57: | Line 57: | ||
|p63= keysAndValues: [[Array]] - in format depending on ''splitArray''<nowiki/>'s value: | |p63= keysAndValues: [[Array]] - in format depending on ''splitArray''<nowiki/>'s value: | ||
* [[true]] - {{hl|[<nowiki/>[key1, key2, ...], [value1, value2, ...]]}} | * [[true]] - {{hl|[<nowiki/>[key1, key2, ...], [value1, value2, ...]]}} | ||
* [[false]] - {{hl|[<nowiki/>[key1, value1], [key2, value2], ...]}} (same as {{ | * [[false]] - {{hl|[<nowiki/>[key1, value1], [key2, value2], ...]}} (same as {{Link|#Syntax 3}}) | ||
|r4= [[Nothing]] | |r4= [[Nothing]] |
Revision as of 17:43, 4 January 2023
Description
- Description:
- Inserts multiple values into Array/String/HashMap.
The String variant also supports forceUnicode. - Groups:
- HashMapArraysStrings
Syntax 1
- Syntax:
- array insert [index, valuesToInsert, onlyIfUnique]
- Parameters:
- array : Array
- index: Number - index at which the values will be inserted, -1 for append.
- valuesToInsert: 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], ...]
- Parameters:
- hashMap: HashMap
- key: HashMapKey
- value: Anything
- Return Value:
- Nothing
Syntax 4
- Syntax:
- hashMap insert [splitArray, [keysAndValues]]
- Parameters:
- hashMap: HashMap
- splitArray: Boolean - determines keysAndValues format (see keysAndValues's description)
- keysAndValues: Array - in format depending on splitArray's value:
- Return Value:
- Nothing
Examples
- Example 1:
- "Test" insert [0, "Radio"]; // returns "RadioTest"
Additional Information
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