<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>hi<BR>
&nbsp;<BR>
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:<BR>
word is a single word and str is a string.<BR>
&nbsp;<BR>
match :: String -&gt; String -&gt; (Bool, String)<BR>match word str <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | if removeSpace str `elem` (removeSpace word) ++ rest = (True, rest)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;| otherwise == (False,str)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;where rest = str<BR>
&nbsp;<BR>
Any help?<BR>
&nbsp;<BR>
Ryan&nbsp;<BR>&nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR><br /><hr />Can you guess the film? <a href='https://www.searchcharades.com' target='_new'>Search Charades!</a></body>
</html>