[Haskell-cafe] matching

Ryan Bloor ryanbloor at hotmail.com
Thu Dec 6 02:03:10 EST 2007


hi
 
I have a matching problem... I am wanting to identify whether or not a string is an opening substring of another (ignoring leading spaces). I have this:
word is a single word and str is a string.
 
match :: String -> String -> (Bool, String)match word str                   | if removeSpace str `elem` (removeSpace word) ++ rest = (True, rest)                  | otherwise == (False,str)                      where rest = str
 
Any help?
 
Ryan  
 
 
_________________________________________________________________
The next generation of MSN Hotmail has arrived - Windows Live Hotmail
http://www.newhotmail.co.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20071206/c3d15e94/attachment.htm


More information about the Haskell-Cafe mailing list