Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 687 Bytes

StringsCollections.md

File metadata and controls

30 lines (21 loc) · 687 Bytes

Strings Collection

\VersatileCollections\StringsCollection is a Collection class that only accepts items that are strings.

Example Usage:

    
    $collection = new \VersatileCollections\StringsCollection(
        '1', '2', '3', '4', '5', '6', '7'
    );

    // OR
    
    $collection = \VersatileCollections\StringsCollection::makeNew(
        ['1', '2', '3', '4', '5', '6', '7']
    );

    // OR

    $collection = new \VersatileCollections\StringsCollection();
    $collection[] = '4';
    $collection[] = '5';
    $collection[] = '7';
    $collection[] = '9';

A good use-case for this type of collection would be in applications that require a list of strings.