let rec remove_right_space (s : string) (l : int) (i : int) : string = ( if (i<l) then (if ((String.get s (l-i-1))=' ') then (remove_right_space s l (i+1)) else (String.sub s 0 (l-i));) else ""; )