listInsert: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
m (Applied Template:MacroFunction)
Line 1: Line 1:
==Function listInsert==
{{MacroFunction
 
|name=listInsert
|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===
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: newList = listInsert(list, index, value)]
[h: newList = listInsert(list, index, value)]
Line 9: Line 10:
</source>
</source>


===Example===
|example=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[r: listInsert("This, a , test", 1, "is")]
[r: listInsert("This, a , test", 1, "is")]
Line 19: Line 20:
</source>
</source>
Returns This: is: a: test
Returns This: is: a: test
}}
[[Category:String List Function]]

Revision as of 02:51, 9 March 2009

listInsert() Function

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

[h: newList = listInsert(list, index, value)]
[h: newList = 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