Helper function to coordinate the "string splitting"

@return void
@throws UnsupportedFeatureException
976372
private function generateIteratorElements()
    {
        if ($this->subject === '') {
            $this->iteratorCache->append(new TextIteratorElement(self::DONE, -1));
            return;
        }

        if ($this->iteratorType === self::CODE_POINT) {
            throw new UnsupportedFeatureException('Unsupported iterator type.', 1210849150);
        } elseif ($this->iteratorType === self::COMB_SEQUENCE) {
            throw new UnsupportedFeatureException('Unsupported iterator type.', 1210849151);
        } elseif ($this->iteratorType === self::CHARACTER) {
            $this->parseSubjectByCharacter();
        } elseif ($this->iteratorType === self::WORD) {
            $this->parseSubjectByWord();
        } elseif ($this->iteratorType === self::LINE) {
            $this->parseSubjectByLine();
        } elseif ($this->iteratorType === self::SENTENCE) {
            $this->parseSubjectBySentence();
        }

        $this->iteratorCache->append(new TextIteratorElement(self::DONE, -1));
        $this->iteratorCacheIterator = $this->iteratorCache->getIterator();
    }
953913
public static function str_split(&$str, int $split_length=1) {
		if ($split_length < 1) {
			$str = false;
			return false;
		}

		cast::string($str, true);

		$str_length = v_mb::strlen($str);
		$out = array();

		for ($i = 0; $i < $str_length; $i += $split_length) {
			$out[] = v_mb::substr($str, $i, $split_length);
		}

		$str = $out;
		return true;
	}
188572
protected function _eatWhitespace()
    {
        if (preg_match('/([\t\b\f\n\r ])*/s', $this->source, $matches, PREG_OFFSET_CAPTURE, $this->offset)
            && $matches[0][1] == $this->offset) {
            $this->offset += strlen($matches[0][0]);
        }
    }
739742
private function splitString($string)
    {
        $result = array();
        for ($i = 0; $i < mb_strlen($string, "UTF-8"); ++$i) {
            $result[] = mb_substr($string, $i, 1, "UTF-8");
        }
        return $result;
    }
615715
function (delimiter, string, limit) {

            if (arguments.length < 2 ||
                typeof delimiter === "undefined" ||
                typeof string === "undefined"
            ) {
                return null;
            }

            if (delimiter === "" ||
                delimiter === false ||
                delimiter === null
            ) {
                return false;
            }

            if (delimiter === true) {
                delimiter = "1";
            }

            // Here we go...
            delimiter += "";
            string += "";

            var splited = string.split(delimiter);

            if (typeof limit === "undefined") {
                return splited;
            }

            // Support for limit
            if (limit === 0) {
                limit = 1;
            }

            // Positive limit
            if (limit > 0) {
                if (limit >= splited.length) {
                    return splited;
                }

                return splited.slice(0, limit - 1)
                    .concat([splited.slice(limit - 1)
                        .join(delimiter)
                    ]);
            }

            // Negative limit
            if (-limit >= splited.length) {
                return [];
            }

            splited.splice(splited.length + limit);

            return splited;
        }
115525
private function parsing() : void
    {
        $lines = explode("\n", $this->raw);

        foreach ($lines as $line) {
            // check "at" mark
            if (false === strpos($line, '@')) {
                continue;
            }

            // check inline annotation
            if ($anp = strpos($line, '//')) {
                $line = substr($line, 0, $anp);
            }

            // trim blanks
            $line = trim(ltrim($line, ' *'));

            // analyze expr
            if (false === $fws = strpos($line, ' ')) {
                // @some-key
                $key = substr($line, 1);
                $val = true;
            } else {
                // @some-key some-val
                $key = substr($line, 1, $fws - 1);
                $val = trim(substr($line, $fws));
            }

            $this->lines[] = [$key, $val];

            $this->declares[$key][] = $val;
        }
    }
358854
public function splitString($string)
    {
        if ($this->digits->hasStringConflict()) {
            throw new \RuntimeException('The number base does not support string presentation');
        }

        $pattern = $this->getDigitPattern();

        if ((string) $string === '') {
            $digits = [];
        } elseif (is_int($pattern)) {
            $digits = str_split($string, $this->digitPattern);
        } else {
            preg_match_all($pattern, $string, $match);
            $digits = $match[0];
        }

        return $this->canonizeDigits($digits);
    }
1315970
private function split()
    {
        $this->splitter->setArchivePath($this->archivePath);
        $this->splitter->executeSplit();
        $this->archivePath = $this->splitter->getSplitFiles();
    }
864326
protected function consumeMultipleLineComment()
    {
        $this->get();
        $comment = '';
        for (;;) {
            $get = $this->get();
            if ($get === '*') {
                if ($this->peek() === '/') { // end of comment reached
                    $this->get();
                    if ($this->keptComments && (0 === strpos($comment, '!'))) {
                        // preserved by YUI Compressor
                        if (empty($this->keptComment)) {
                            // don't prepend a newline if two comments right after one another
                            $this->keptComment = "\n";
                        }
                        $this->keptComment .= "/*!" . substr($comment, 1) . "*/\n";
                    } elseif (preg_match('/^@(?:cc_on|if|elif|else|end)\\b/', $comment)) {
                        // IE conditional
                        $this->keptComment .= "/*{$comment}*/";
                    }

                    return;
                }
            } elseif ($get === null) {
                throw new JSMin_UnterminatedCommentException(
                    "JSMin: Unterminated comment at byte {$this->inputIndex}: /*{$comment}");
            }
            $comment .= $get;
        }
    }
1365984
public function parseFromArray()
    {
        $this->chunk = '';
        // read the length byte
        $length = $this->reader->next();
        // just take the splice from this array
        $this->childParseFromArray($length);
    }
791242
public function asUniversalString(): Primitive\UniversalString
    {
        if (!$this->_element instanceof Primitive\UniversalString) {
            throw new \UnexpectedValueException(
                $this->_generateExceptionMessage(Element::TYPE_UNIVERSAL_STRING));
        }
        return $this->_element;
    }
700773
protected function split(array &$str, $pattern)
    {
        $tokens = array();
        foreach ($str as $s) {
            $tokens = array_merge(
                $tokens,
                preg_split($pattern, $s, null, PREG_SPLIT_NO_EMPTY)
            );
        }

        $str = $tokens;
    }
1120950
protected static function splitCompoundStringIntoParts($name, $value)
    {
        if (strpos($name, '=') !== false) {
            list($name, $value) = array_map('trim', explode('=', $name, 2));
        }

        return array($name, $value);
    }
553480
public function interpString($m)
    {
        // this should only be called for doubly quoted strings
        // and triple-double quotes
        //
        // interpolation is betwee ${ ... }
        $patterns = array('interp' => '/(?<!\\$)\\$\\{/');
        $start = $this->pos();
        if (preg_match('/^"""/', $m[0])) {
            $patterns['term'] = '/"""/';
            $this->posShift(3);
        } else {
            assert(preg_match('/^"/', $m[0]));
            $patterns['term'] = '/"/';
            $this->posShift(1);
        }
        while (1) {
            $p = $this->pos();
            list($name, $index, $matches) = $this->getNextNamed($patterns);
            if ($name === null) {
                // no matches, terminate
                $this->record(substr($this->string(), $start), 'STRING');
                $this->terminate();
                break;
            } elseif ($name === 'term') {
                // end of the string
                $range = $index + strlen($matches[0]);
                $this->record(substr($this->string(), $start, $range - $start), 'STRING');
                $this->pos($range);
                break;
            } else {
                // interpolation, handle this with a subscanner
                $this->record(substr($this->string(), $start, $index - $start), 'STRING');
                $this->record($matches[0], 'DELIMITER');
                $subscanner = new GroovyScanner($this->string());
                $subscanner->interpolation = true;
                $subscanner->init();
                $subscanner->pos($index + strlen($matches[0]));
                $subscanner->main();

                $tagged = $subscanner->tagged();
                $this->record($tagged, 'INTERPOLATION', true);
                $this->pos($subscanner->pos());
                if ($this->scan('/\\}/')) {
                    $this->record($this->match(), 'DELIMITER');
                }
                $start = $this->pos();
            }
            assert($p < $this->pos());
        }
    }
628613
function splitString( $text )
    {
        $text = self::removeDuplicatedSpaces( trim( self::removeAllQuotes( $text ) ) );

        return empty( $text ) ? array() : explode( " ", $text );
    }
960855
function split_text($offset)
    {
        if ($offset == 0) {
            return null;
        }

        $split = $this->_frame->get_node()->splitText($offset);

        $deco = $this->copy($split);

        $p = $this->get_parent();
        $p->insert_child_after($deco, $this, false);

        if ($p instanceof Inline) {
            $p->split($deco);
        }

        return $deco;
    }
923413
def _split(string, splitters):
    """"""
    part = ''
    for character in string:
        if character in splitters:
            yield part
            part = ''
        else:
            part += character
    yield part