HH\Lib\Str\strip_suffix

Requires the Hack Standard Library to be installed.
Facebook Engineer?

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

Returns the string with the given suffix removed, or the string itself if it doesn't end with the suffix

namespace HH\Lib\Str;

function strip_suffix(
  string $string,
  string $suffix,
): string;

Parameters

  • string $string
  • string $suffix

Returns

  • string