DOKK / manpages / debian 12 / libbson-doc / bson_string_truncate.3.en
BSON_STRING_TRUNCATE(3) libbson BSON_STRING_TRUNCATE(3)

bson_string_truncate - bson_string_truncate()

void
bson_string_truncate (bson_string_t *string, uint32_t len);


  • string: A bson_string_t.
  • len: The new length of the string, excluding the trailing \0.

Truncates the string so that it is len bytes in length. This must be smaller or equal to the current length of the string.

A \0 byte will be placed where the end of the string occurs.

MongoDB, Inc

2017-present, MongoDB, Inc

October 20, 2022 1.23.1