package stdune

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Stdune.String_builderSource

Sourcetype t

A buffer for efficiently building strings.

Sourceval create : int -> t

Creates a t with the given capacity.

Sourceval add_char : t -> char -> unit

Adds a char to the end of the buffer.

Sourceval add_string : t -> string -> unit

Adds a string to the end of the buffer.

Sourceval add_substring : t -> string -> pos:int -> len:int -> unit

Adds a substring to the end of the buffer.

Sourceval 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.

OCaml

Innovation. Community. Security.