Re: [Flashcoders] searching a string
> If I had a string: > > Leadership > > And I was comparing a word: > > Leader > > How could I have the comparison show it as true since the string Leader is in > Leadership? > > Does this even make sense?? So if I was comparing Swim and Leadership it > would be false but Leader and Leadership would be > true... kind of like if I did a SQL statement such as: > > .fieldName LIKE "%Leader%" AS, like JavaScript, has a built-in library of string functions. Most of them have the same names and work the same as they do in JavaScript. The indexOf function lets you search for the existence of a substring. http://www.foundation-flash.com/tutorials/stringfunctions2/ I'm not sure why everyone else is recommending the use of regular expressions, which seem massive overkill for what you're trying to do. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] searching a string
Hi, Look at Regular Expressions - RegExp class... If you are doing anything with RegExp, download Grant Skinners RegEx tool: http://www.gskinner.com/blog/archives/2008/03/regexr_free_onl.html Glen On 21/06/2010 15:24, Lehr, Theodore wrote: If I had a string: Leadership And I was comparing a word: Leader How could I have the comparison show it as true since the string Leader is in Leadership? Does this even make sense?? So if I was comparing Swim and Leadership it would be false but Leader and Leadership would be true... kind of like if I did a SQL statement such as: .fieldName LIKE "%Leader%" ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] searching a string
Look at Regular Expression (RegExp) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Lehr, Theodore Sent: maandag 21 juni 2010 16:25 To: Flash Coders List Subject: [Flashcoders] searching a string If I had a string: Leadership And I was comparing a word: Leader How could I have the comparison show it as true since the string Leader is in Leadership? Does this even make sense?? So if I was comparing Swim and Leadership it would be false but Leader and Leadership would be true... kind of like if I did a SQL statement such as: .fieldName LIKE "%Leader%" ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Geen virus gevonden in het binnenkomende-bericht. Gecontroleerd door AVG - www.avg.com Versie: 9.0.829 / Virusdatabase: 271.1.1/2950 - datum van uitgifte: 06/20/10 20:36:00 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] searching a string
If I had a string: Leadership And I was comparing a word: Leader How could I have the comparison show it as true since the string Leader is in Leadership? Does this even make sense?? So if I was comparing Swim and Leadership it would be false but Leader and Leadership would be true... kind of like if I did a SQL statement such as: .fieldName LIKE "%Leader%" ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders