Here is the OCaml version (utilizing ExtLib):
open ExtLib;; open String;; open List;; let reverse_words s = join " " (rev (remove_all (nsplit s " ") ""));;
In reply to Re: Five Ways to Reverse a String of Words (C#, Perl 5, Perl6, Ruby, Haskell)
by stvn
in thread Five Ways to Reverse a String of Words (C#, Perl 5, Perl 6, Ruby, Haskell)
by eyepopslikeamosquito
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |