BloombergLP::bdlb::String::rtrim

Compute the length of string after removing trailing whitespace.

Synopsis

Declared in <bdlb_string.h>

static
void
rtrim(
    char const* string,
    int* length);

Description

Determine the number of characters that the specified string having the specified length would have if all trailing whitespace characters were removed and load the result into *length. string is not modified. The behavior is undefined unless 0 <= *length. Note that length is both an input and output parameter.

Parameters

NameDescription
stringstring whose trailing whitespace length is measured
lengthlength of string; updated to the trimmed length