BloombergLP::bdlb::String::trim

Remove leading and trailing whitespace from string.

Synopsis

Declared in <bdlb_string.h>

static
void
trim(char* string);

Description

Remove all leading and trailing whitespace characters from the specified string. If string consists of only whitespace then it will be empty (i.e., have 0 length) after this operation. The behavior is undefined unless string->size() <= INT_MAX (if applicable). See bdlb_stringviewutil for an identically named method having similar semantics taking (and returning) bsl::string_view.

Parameters

NameDescription
stringnull-terminated string to trim