<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>hi<BR>
<BR>
I have four functions below: What I want to do is have a way to parse more than one digit or more than one string head in ParseTrue. Any ideas...<BR>
<BR>
removeSpace:: String -> String<BR>removeSpace = dropWhile (`elem` space) <BR> where space = [' ']<BR>
<BR>
match :: String -> String -> (Bool, String)<BR>match word str <BR> | ((isPrefixOf) (removeSpace word) (removeSpace str)) = (True,rest)<BR> | otherwise = (False,str)<BR> where rest = drop (length (removeSpace word)) (removeSpace str)<BR> <BR>parseDigit :: String -> [(Int, String)]<BR>parseDigit (x:xs) <BR> | isDigit x = [(read [x],xs)]<BR> | otherwise = []<BR>
<BR>
parseTrue :: String -> (Bool, String)<BR>parseTrue x = match "True" x<BR>
<BR>
<BR>
<BR>
Ryan<BR> <BR><BR>
<BR>
<BR>
<BR>
<BR><br /><hr />Get closer to the jungle… <a href='http://entertainment.uk.msn.com/tv/realitytv/im-a-celebrity/' target='_new'>I'm a Celebrity Get Me Out Of Here!</a></body>
</html>