src/Primitive/String/String.php
public function offsetGet($args)
    {
        if ( ! $this->isStringable($args, true) || strpos($args, ':') === false)
        {
            return $this->at($args);
        }

        return $this->slice($args);
    }
public function offsetGet($args)
    {
        if ( ! $this->isStringable($args, true) || strpos($args, ':') === false)
        {
            return $this->at($args);
        }

        return $this->slice($args);
    }
Get offset. Implements python-like string slices.
If slice (['2:4:1']) is not present it will return char at offset,
otherwise slices the string if the offset
contains at least a single colon. Slice notation follow the format
"start:stop:step". If no colon is present, returns the character at the
given index. Offsets may be negative to count from the last character in
the string. Throws an exception if the index does not exist, more than 3
slice args are given, or the step is 0.

@param int|string|StringContract $args
@return \im\Primitive\String\String