Created
          May 7, 2011 05:34 
        
      - 
      
- 
        Save philtomson/960227 to your computer and use it in GitHub Desktop. 
    string reverse in ocaml
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | let string_rev str = | |
| let rec aux idx = match idx with | |
| 0 -> Char.escaped (str.[0]) | |
| | _ -> (Char.escaped str.[idx]) ^ (aux (idx-1)) in | |
| aux ((String.length str)-1) ;; | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment