In a message dated 3/21/00 1:28:48 PM Eastern Standard Time, 
[EMAIL PROTECTED] writes:

> > I'm using StrNCaselessCompare to compare two strings but if the strings
>  > don't start in the same way the strings don't match.
>  >
>  > Like comparing "asdf" with "sdf" using length 3 doesn't match.
>  >
>  > How can I solve this?
>  
>  As far as I know, there is no support for such comparisons in the operating
>  system, so you'll have to write your own function to do this. You need to
>  think about how you want to define your measure of how similar two strings
>  are, then come up with a piece of code that answers that question. This may
>  not be as simple as it looks. One possible measure is the length of the
>  longest common substring. This may not be the measure you want, but if it
>  is, at least the problem is well known. You're getting into computer 
science
>  algorithm territory. Depending on the length of the strings involved, you
>  may be able to get away with simple brute force algorithms.

Dr. Dobb's had an article on string pattern matching about 10 years ago that 
you might want to look into (boy do I feel old bringing this up).
-Pete

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to