EFUN: member

SYNTAX:
int member( arg, elem );
  mixed *arg | string arg | mapping arg;
  mixed elem;

DESCRIPTION:
Member checks whether 'elem' is an element of the given array, string or
mapping. In case of an array, the 'elem' should be of the same type as
the elements of the array ( not within ({ }) ). If 'arg' is a string,
then 'elem' should be one character between single quotes, or the int
equivalent as defined in the standard ASCII table. In case 'arg' is of
type mapping, 'elem' must be a string that will be matched to the indices
of the mapping.

RETURN VALUES:
For arrays, it returns the position of the element in the array, or -1
if the 'elem' is not part of the array.
For strings, it returns the position of the character in the string,
or -1 if the character is not part of the string.
For both arrays and strings, if the 'elem' occurs at multiple locations,
the position of the first location is returned.
For mappings, it returns 1 if the string is equal to one of the indices
of the mapping, or 0 if it isn't.

SEE ALSO:
member_array
sizeof
m_sizeof
strlen

EXAMPLE:
[example 1]
string *str;
int i;

str = ({ "Holy", " ", "Mission", " ", "mud" });
i = member( str, " " );
// i is now 1.

[exampe 2]
int i;

i = member( "abcdefghij", 't' );
// i is now -1.
// 't' could alternatively be replaced by 116, the ASCII code for t.

[example 3]
mapping mp;
int i;

mp = ([ "Robin":"Hood", "Richard":"Lionheart", "Friar":"Tuck" ]);
i = member( mp, "Robin" );
// i is now 1.
i = member( mp, "Hood" );
// i is now 0, because member only checks on indices, not values.
