Member(): Difference between revisions

From TinyMUX
Jump to navigation Jump to search
New page: Category:Functions {{Function|member(<list>, <word>[, <delim>])}} Member takes a list and a word, and returns the position of that word within the list. If the word does not occur i...
 
(No difference)

Latest revision as of 22:01, 25 November 2010


member(<list>, <word>[, <delim>])

Member takes a list and a word, and returns the position of that word within the list. If the word does not occur in the list, then 0 is returned. Unlike match(), member() does not check for wildcard-ing, and the cases of <list> and <word> are significant. A word is defined as a string which has no interior spaces. So 'hello' would be one word, while 'hello there' would be two.

Example

> say member(This is a member test, member)

You say, "4"


> say member(This is a member test, Member)

You say, "0"


> say member(This is a member test, *e*)

You say, "0"


> say member(This is a member test, is a)

You say, "0"

LISTS, match(), strmatch()