ltd-beget/stringstream

Php Stringstream data structure.

v2.0.0 2022-01-26 16:24 UTC

This package is not auto-updated.

Last update: 2024-11-01 03:58:32 UTC


README

Latest Stable Version Total Downloads Scrutinizer Code Quality License MIT

Php Stringstream data structure.

Installation

composer require ltd-beget/stringstream

Usage

<?php
    use LTDBeget\stringstream\StringStream;
    
    require(__DIR__ . '/vendor/autoload.php');
    
    $stream = new StringStream("Hello, World!");
    
    do {
        if($stream->currentAscii()->isWhiteSpace()) {
            $stream->ignoreWhitespace();
        } else {
            echo $stream->current().PHP_EOL;
            $stream->next();
        }
    
    } while (! $stream->isEnd());

License

released under the MIT License. See the bundled LICENSE file for details.