listInsert: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Added version.)
Line 1: Line 1:
{{MacroFunction
{{MacroFunction
|name=listInsert
|name=listInsert
|version=1.3b42
|description=
|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
Line 6: Line 7:
|usage=
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: newList = listInsert(list, index, value)]
listInsert(list, index, value)
[h: newList = listInsert(list, index, value, delim)]
</source>
<source lang="mtmacro" line>
listInsert(list, index, value, delim)
</source>
</source>



Revision as of 10:28, 10 March 2009

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", ":")]
Returns This: is: a: test