2019-09-12 10:33:56 -07:00
|
|
|
let rec revs_aux strin list index =
|
2013-04-10 23:57:08 -07:00
|
|
|
if List.length list = String.length strin
|
|
|
|
|
then String.concat "" list
|
2019-09-12 10:33:56 -07:00
|
|
|
else revs_aux strin ((String.sub strin index 1)::list) (index+1)
|
|
|
|
|
|
|
|
|
|
let revs s = revs_aux s [] 0
|
|
|
|
|
|
|
|
|
|
let () =
|
|
|
|
|
print_endline (revs "Hello World!")
|