public static function substringBetween($str, $open, $close = null)
    {
        $result = null;

        if (null === $close) {
            $close = $open;
        }

        $startPos = self::indexOf($str, $open);

        if (self::INDEX_NOT_FOUND !== $startPos) {
            $startPos += self::length($open);
            $endPos = self::indexOf($str, $close, $startPos);

            if (self::INDEX_NOT_FOUND !== $endPos) {
                $result = self::substring($str, $startPos, $endPos);
            }
        }

        return $result;
    }