Skip to content

Instantly share code, notes, and snippets.

@alarsyo
Last active March 23, 2016 19:16
Show Gist options
  • Save alarsyo/1cd62ca4eb5ef458e67e to your computer and use it in GitHub Desktop.
Save alarsyo/1cd62ca4eb5ef458e67e to your computer and use it in GitHub Desktop.
String tools
yourstring.[i] ;; (* retourne le caractère de rang i de ta chaîne de caractères *)
"exemple".[4] ;;
(* - : char = 'p' *)
(* le rang va de 0 à (n-1), attention ! *)
String.make n char ;; (* construit à partir de ton caractère char une string longue de n caractères *)
String.make 1 'e' ;;
(* - : string = "e" *)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment