This API is part of the Hack Standard Library, not HHVM itself.
Facebook Engineer?

This function is available as Str\trim_right() in Facebook's www repository.

Returns the given string with whitespace stripped from the right


namespace HH\Lib\Str;

function trim_right(
  string $string,
  ?string $char_mask = null,
): string;

See Str\trim for more details.

To strip from both ends, see Str\trim. To only strip from the left, see Str\trim_left.


  • string $string
  • ?string $char_mask = null