3 Replies Latest reply on May 11, 2008 10:06 PM by pandxsg

    How do I check if a string is inside an array?

    pandxsg Level 1
      Hi,

      Let's say I've got a multidimensional array:

      fruits=[["apple","orange","mango"],["durian","pineapple"]];

      if("mango"==fruits[0][2]){
      trace("yeah!");
      }

      This is assuming I know "mango" is in "fruits[0][2]", however, how do i check the whole array for "mango"? That is, as long as "mango" is inside the array "fruits", there will be an output?

      Thanks in advance,
      Alan