searching for chars within a string

dunbarx at aol.com dunbarx at aol.com
Tue Sep 23 23:07:30 EDT 2014


So much fun.


A few ways to do this. How much do you know about arrays?


Or if you like more old-fashioned sorts of methods, think about this. What if you made a repeat loop that examined each character in the source, "AELPP", one by one. If that char exists in the target string, then delete that char from the target. Then you will either go through the entire source, in which case you know all the chars were there to begin with, or you will fail, in which case, well, you get the picture.


Can you think of yet another way?


Craig Newman



-----Original Message-----
From: larry <larry at significantplanet.org>
To: use-livecode <use-livecode at lists.runrev.com>
Sent: Tue, Sep 23, 2014 8:23 pm
Subject: searching for chars within a string


Hello,

I have done a lot research and cannot find any way to do this:

I have a string, "AELPP" and I want to see if all 5 of those letters are in 
"search string"

If search string is:  ABCDEKLP,   then NO it isn't because there are two P's in 
the string I'm searching for.

But if search string is:  ABCDEKLLLMMOOPP, then YES the string I'm searching for 
is found in the search string.

It is important to my program that I just find the 5 chars anywhere within the 
search string and they do not have to be sequential in the search string.

Thanks for any help,
Larry
_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

 



More information about the use-livecode mailing list