listInsert: Difference between revisions
Jump to navigation
Jump to search
(New page: ==Function listInsert== Inserts a value into the Macros:string list at the specified index. If a delimiter is not specified then the default value of ',' is used. The index for lists...) |
No edit summary |
||
(7 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
= | {{MacroFunction | ||
|name=listInsert | |||
|version=1.3b42 | |||
|description= | |||
Inserts a value into the [[Macros:string list|string list]] at the specified index. If a delimiter is not specified then the default value of ',' is used. The index for lists starts at 0 | Inserts a value into the [[Macros:string list|string list]] at the specified index. If a delimiter is not specified then the default value of ',' is used. The index for lists starts at 0 | ||
|usage= | |||
< | <syntaxhighlight lang="mtmacro" line> | ||
listInsert(list, index, value) | |||
</syntaxhighlight> | |||
</ | <syntaxhighlight lang="mtmacro" line> | ||
listInsert(list, index, value, delim) | |||
</syntaxhighlight> | |||
|example= | |||
< | <syntaxhighlight lang="mtmacro" line> | ||
[r: listInsert("This, a , test", 1, "is")] | [r: listInsert("This, a , test", 1, "is")] | ||
</ | </syntaxhighlight> | ||
Returns This, is, a, Test | Returns This, is, a, Test | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[r: listInsert("This: a: test", 1, "is", ":")] | [r: listInsert("This: a: test", 1, "is", ":")] | ||
</ | </syntaxhighlight> | ||
Returns This: is: a: test | Returns This: is: a: test | ||
}} | |||
[[Category:String List Function]] |
Latest revision as of 23:59, 15 March 2023
listInsert() Function
• Introduced in version 1.3b42
Inserts a value into the string list at the specified index. If a delimiter is not specified then the default value of ',' is used. The index for lists starts at 0
Usage
listInsert(list, index, value)
listInsert(list, index, value, delim)
Example
[r: listInsert("This, a , test", 1, "is")]
Returns This, is, a, Test
[r: listInsert("This: a: test", 1, "is", ":")]