public static function explode(string $subject, string $delimiter, int $limit = null): Bag
    {
        if (empty($delimiter)) {
            return new Bag();
        }
        $parts = $limit === null ? explode($delimiter, $subject) : explode($delimiter, $subject, $limit);

        return new Bag($parts ?: []);
    }
public static function explode(string $subject, string $delimiter, int $limit = null): Bag
    {
        if (empty($delimiter)) {
            return new Bag();
        }
        $parts = $limit === null ? explode($delimiter, $subject) : explode($delimiter, $subject, $limit);

        return new Bag($parts ?: []);
    }
public static function explode ( string $ subject , string $ delimiter , int $ limit = null ) : Bag { if ( empty ( $ delimiter ) ) { return new Bag ( ) ; } $ parts = $ limit === null ? explode ( $ delimiter , $ subject ) : explode ( $ delimiter , $ subject , $ limit ) ; return new Bag ( $ parts ? : [ ] ) ; }
Splits a string on the delimiter.

@param string $subject   The string to split
@param string $delimiter The term to split on
@param int    $limit     If limit is set and positive, the returned array will contain a maximum of limit
elements with the last element containing the rest of string.

If the limit parameter is negative, all components except the last -limit are returned.

If the limit parameter is zero, then this is treated as 1.

@return Bag A bag containing the string parts.
The bag will be empty if the delimiter is an empty string or
if delimiter contains a value that is not contained in string
and a negative limit is used.
Splits a string on the delimiter .