stdune
Stdune.String_builder
stdune.filesystem_stubs
type t
A buffer for efficiently building strings.
val create : int -> t
Creates a t with the given capacity.
t
val add_char : t -> char -> unit
Adds a char to the end of the buffer.
char
val add_string : t -> string -> unit
Adds a string to the end of the buffer.
string
val add_substring : t -> string -> pos:int -> len:int -> unit
Adds a substring to the end of the buffer.
val build_exact_exn : t -> string
Returns the built string. Raises if the buffer is not full. Subsequent calls to add_char or add_string will also raise.
add_char
add_string