Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ------------------------------------funzione SPLIT delle istruzioni e argomenti-----------------------------------------------------------------
- let rec separa (xs : char list) : string =
- match xs with
- [] ->""
- | z::zs -> if z = ' '
- then ""
- else string z + separa zs;;
- let rec avanti (xs : char list) : char list =
- match xs with
- []->[]
- |z::zs -> if z = ' '
- then zs
- else avanti zs;;
- let rec split (xs : char list) : string list =
- match xs with
- [] -> []
- | z::zs ->if z=' '
- then split (avanti xs)
- else [separa xs] @ split (avanti xs);;
- // ------------------------------------------------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement