Quick question about delimiters
turbosol <[email protected]> Thu, 31 May 2007 19:55:38 -0700 (PDT)
| Newsgroups | gmane.comp.lang.sml.smlnj |
|---|---|
| Message-ID | <[email protected]> |
I am in need of writing a function to take away delimters from a string so it
will be a string of only letters. I have to do this without using any built
in functions... I feel like i am close, and logically, I fell like my code
should work, but i am getting problems when i call it. this is what i have
so far.
fun remele (x, L) =
if null L then nil
else if hd x = hd L then remele(x,(tl L))
else if null(tl L) then remele(tl x, L) -(*- I am not sure if this is
correct, but i want too check to see
else hd(L)::remele(x, tl L); -(*if all elements were checked to then
go to the next element to check
remele([#" ", #",",#";",#".",#"\n",#"!",#"?"], explode("Hello, this is a
string!"));
should yield "hellothisisastring"
any suggestions?
--
View this message in context: http://www.nabble.com/Quick-question-about-delimiters-tf3850025.html#a10905791
Sent from the SML/NJ mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/