HH\Lib\Str\strip_prefix

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

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

Returns the string with the given prefix removed, or the string itself if it doesn't start with the prefix

namespace HH\Lib\Str;

function strip_prefix(
  string $string,
  string $prefix,
): string;

Parameters

  • string $string
  • string $prefix

Returns

  • string