HH\Lib\Str\search_l

Meta Engineer?

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

Returns the first position of the "needle" string in the "haystack" string, or null if it isn't found

namespace HH\Lib\Str;

function search_l(
  \HH\Lib\Locale\Locale $locale,
  string $haystack,
  string $needle,
  int $offset = 0,
): ?int;

An optional offset determines where in the haystack the search begins. If the offset is negative, the search will begin that many characters from the end of the string. If the offset is out-of-bounds, a InvalidArgumentException will be thrown.

Guide

Parameters

  • \HH\Lib\Locale\Locale $locale
  • string $haystack
  • string $needle
  • int $offset = 0

Returns

  • ?int