insert: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Never gonna let you down (forceUnicode support for string insert))
m (Text replacement - " {3,}\|" to " |")
Line 19: Line 19:


|r1= [[Nothing]]
|r1= [[Nothing]]


|s2= string [[insert]] [index, substring]
|s2= string [[insert]] [index, substring]
Line 28: Line 27:


|r2= [[String]] - The new string
|r2= [[String]] - The new string


|s3= hashMap [[insert]] <nowiki>[[</nowiki>key1, value1], [key2, value2], ...]
|s3= hashMap [[insert]] <nowiki>[[</nowiki>key1, value1], [key2, value2], ...]

Revision as of 17:41, 18 January 2021

-wrong parameter ("arma3dev") defined!-[[:Category:Introduced with arma3dev version 2.01|2.01]]
Hover & click on the images for description

Description

Description:
Inserts multiple values into Array/String/HashMap.
The String variant also supports forceUnicode.
Groups:
HashMapArrays

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: Bool - 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

Examples

Example 1:
Example 2:

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

[[Category:Introduced with arma3dev version 2.01]][[ Category: arma3dev: New Scripting Commands | INSERT]][[ Category: arma3dev: Scripting Commands | INSERT]]