let rev s = let sl = String.length s in let s' = String.create sl in for i = 0 to sl - 1 do s'.[i] <- s.[sl - i - 1] done; s'