Member()

From TinyMUX
Revision as of 22:01, 25 November 2010 by Ihavenomouth (talk | contribs) (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...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


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"

Related Topics

LISTS, match(), strmatch()