Meta Engineer?

This is available as Str\pad_left_l in the www repository.

Returns the string padded to the total length (in characters) by appending the $pad_string to the left

namespace HH\Lib\Str;

function pad_left_l(
  \HH\Lib\Locale\Locale $locale,
  string $string,
  int $total_length,
  string $pad_string = ' ',
): string;

If the length of the input string plus the pad string exceeds the total length, the pad string will be truncated. If the total length is less than or equal to the length of the input string, no padding will occur.

To pad the string on the right, see Str\pad_right_l(). To pad the string to a fixed number of bytes, see Str\pad_left().



  • \HH\Lib\Locale\Locale $locale
  • string $string
  • int $total_length
  • string $pad_string = ' '


  • string