2 Replies Latest reply on Jan 15, 2009 3:37 AM by Kalyani Tiwari

    How to check if one string contains part of another

    kmdguy Level 1
      Hi there,

      I'm a FLEX newbie, but an experienced Lingo programmer.

      I'm trying to figure out the syntax for comparing whether or not one string contains all or part of another.
      For example in Lingo:

      "if varString1 contains varString2 then do something"

      I have a bit of code in FLEX that reads:
      if (item.lastName == filterInput.text)
      which checks if an item in an array called "lastName" is identical to the text in a text input field.
      This will then filter a data grid to contain only the items that match (==).

      But what I want is to check if (item.lastName contains filterInput.text), such as "Does catacomb contain 'cat' ".

      I can't seem to find an operator to do this. Any help is appreciated.

      Thanks!