Created
June 13, 2018 10:19
-
-
Save masahitojp/ea91b3054c2574a89d9b486dc37c437c to your computer and use it in GitHub Desktop.
OCaml: int_string to int List
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# #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