let first_chars s n = try String.sub s 0 n with _ -> s