···133133134134### Standard library:
135135136136+- #14440: Add String.of_char
137137+ (Daniel Bünzli, review by Nicolás Ojeda Bär and Gabriel Scherer)
138138+136139- #14362: Add String.{drop,take,cut}_{first,last}_while
137140 (Daniel Bünzli, review by Nicolás Ojeda Bär and David Allsopp)
138141
+1
stdlib/string.ml
···3737let init n f =
3838 B.init n f |> bts
3939let empty = ""
4040+let of_char c = make 1 c
4041let of_bytes = B.to_string
4142let to_bytes = B.of_string
4243let sub s ofs len =
+6
stdlib/string.mli
···103103104104 @raise Invalid_argument if [i] not an index of [s]. *)
105105106106+val of_char : char -> string
107107+(** [of_char c] is [c] as a string.
108108+109109+ @since 5.5
110110+*)
111111+106112val of_bytes : bytes -> string
107113(** Return a new string that contains the same bytes as the given byte
108114 sequence.
+6
stdlib/stringLabels.mli
···103103104104 @raise Invalid_argument if [i] not an index of [s]. *)
105105106106+val of_char : char -> string
107107+(** [of_char c] is [c] as a string.
108108+109109+ @since 5.5
110110+*)
111111+106112val of_bytes : bytes -> string
107113(** Return a new string that contains the same bytes as the given byte
108114 sequence.