View Single Post
  #3  
Old 11-08-2004, 09:31 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Quote:
Originally Posted by Slash-P2P
I find strcontains easy so I use that a lot.
I believe you can get an exact answer with strcontains if you use quotations around the data your searching in.

Nice sig.
If you mean getting the index value, no. Otherwise, please do clarify your post


PHP Code:
//--detecting element in list
  
if (strcontains(#s(foo),bar)) 

  
if (lindexof(bar,foo))

//--finding element in list
  
this.index lindexof(bar,foo);

  for (
i=0;i<sarraylen(bar);i++) {  //<- this is freaking ugly and I will hit you if you use it
    
if (strcontains(#I(bar,i),foo)) {
      
this.index i;
    }
  } 
It depends on what you are doing. As far as which function has the more efficient underlying code, I don't know. (only applicable in determining if an element is in a list though)
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote