PhpOrient\Protocols\Binary\Serialization\CSV::eatString PHP Method

eatString() protected static method

Consume a string.
protected static eatString ( string $input ) : array
$input string The input to consume
return array The collected string and any remaining content.
    protected static function eatString($input)
    {
        $length = strlen($input);
        $collected = '';
        for ($i = 0; $i < $length; $i++) {
            $c = $input[$i];
            if ($c === '\\') {
                // escape, skip to the next character
                $i++;
                $collected .= $input[$i];
                continue;
            } elseif ($c === '"') {
                break;
            } else {
                $collected .= $c;
            }
        }
        return [$collected, substr($input, $i + 1)];
    }