xtd 0.2.0
Loading...
Searching...
No Matches

◆ pad_left() [2/4]

template<typename char_t >
ustring xtd::ustring::pad_left ( size_t  total_width) const
inlinenoexcept

Right-aligns the characters in this string, padding with spaces on the left for a specified total length.

Parameters
total_widthThe number of characters in the resulting string, equal to the number of original characters plus any additional padding characters.
Returns
A new string that is equivalent to the specified string, but right-aligned and padded on the left with as many spaces as needed to create a length of total_width. Or, if total_width is less than the length of the specified string, a new string object that is identical to the specified string.
Remarks
An unicode space is defined as hexadecimal 0x20.
The pad_left(const std::basic_string<char_t>&, int) method pads the beginning of the returned string. This means that, when used with right-to-left languages, it pads the right portion of the string..