BloombergLP::bdlb::String::pad

Pad string on the right with padChar up to length.

Synopsis

Declared in <bdlb_string.h>

static
void
pad(
    std::pmr::string* string,
    std::pmr::string::size_type length,
    char padChar = ' ');

Description

Append repeatedly to the specified string the optionally specified padChar until string has the specified length. If padChar is not specified the space ( ) character is appended. This operation has no effect if string.size() >= length.

Parameters

NameDescription
stringstring to pad
lengthdesired length after padding
padCharcharacter used for padding (default space)