This is available as Str\strip_prefix
in the 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;
string $string
string $prefix
string