Manual:DIL Manual/string in stringlist

From DikuMUD Wiki
Jump to navigation Jump to search


string 'in' stringlist
   Argument 1: A string to find.
   Argument 2: A stringlist to search.
   Returns: 1.. if first string is found in stringlist, or 0 if it is
            non existent. If found the number equals the index of the
            string found plus one.
Example 1:
  s := "c";
  sl := {"a","b","c","d"};
  i := s in sl;
  The result of 'i' is 3, and sl.[i-1] equals "c" (s).
Example 2:

   dilbegin foo();
   code
   {
     if ("james" in activator.names)
       exec("say hello james.",self);
     pause;
   }
   dilend
---~---~---~---~---~---~---~---~---