listCount: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
Line 17: Line 17:


<source lang="mtmacro" line>
<source lang="mtmacro" line>
[r: listCount("This: is: a: test")]  
[r: listCount("This: is: a: test",":")]  
</source>
</source>
Returns 4
Returns 4

Revision as of 16:14, 22 February 2009

Function listCount

Returns the number of items in a string list.

Usage

[h: count = listCount(list)]
[h: count = listCount(list, delim)]

If delim is not specified then the default value of ',' is used as the value separator in the string list

Example

[r: listCount("This, is, a, test")]

Returns 4

[r: listCount("This: is: a: test",":")]

Returns 4