BloombergLP::bdlb::String::toFixedLength

Copy into the specified dstString at most the specified leading dstLength characters from the specified srcString having the specified srcLength. If srcLength < dstLength, after srcString is copied to dstString repeatedly append to dstString the optionally specified padChar until the total number of characters written to dstString is dstLength. If padChar is not specified the space ( ) character is appended. The behavior is undefined unless 0 <= dstLength and 0 <= srcLength.

Synopsis

Declared in <bdlb_string.h>

static
void
toFixedLength(
    char* dstString,
    int dstLength,
    char const* srcString,
    int srcLength,
    char padChar = ' ');