Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
fun reverseString s =
let
fun rev [] acc = acc
| rev (x::xs) acc = rev xs (x::acc)
in
String.implode (rev (String.explode s) [])
end;
val r = reverseString "HELLO";
print(r ^ "\n");Coding works best on desktop or with an external keyboard.