Webiny\Component\StdLib\StdObject\StringObject\ValidatorTrait::startsWith PHP Method

startsWith() public method

Checks if the current string starts with the given $string.
public startsWith ( string | StringObject $string ) : boolean
$string string | StringObject String to check.
return boolean If current string starts with $string, true is returned, otherwise false.
    public function startsWith($string)
    {
        $string = StdObjectWrapper::toString($string);
        $position = $this->stringPosition($string);
        if ($position !== false && $position == 0) {
            return true;
        }
        return false;
    }