Devise\Support\Str::escaped PHP Method

escaped() protected method

..
protected escaped ( string $str ) : integer
$str string
return integer
    protected function escaped($str)
    {
        $lookingback = true;
        $count = 1;
        while ($lookingback && $count < strlen($str)) {
            if (substr($str, $count * -1, 1) === '\\') {
                $count++;
            } else {
                $lookingback = false;
            }
        }
        return --$count;
    }