Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masahitojp/ea91b3054c2574a89d9b486dc37c437c to your computer and use it in GitHub Desktop.
Save masahitojp/ea91b3054c2574a89d9b486dc37c437c to your computer and use it in GitHub Desktop.
OCaml: int_string to int List
# #load "str.cma";;
# List.map int_of_string (Str.split (Str.regexp "[^0-9]+") "1234");;
- : int list = [1234]
# List.map int_of_string (Str.split (Str.regexp "") "1234");;
- : int list = [1; 2; 3; 4]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment