Splits this string into its single words

@param int|null the maximum number of words to return from the start (optional)
@return static[] the new instances of this class
973699
public function words($limit = null) {
		// if a limit has been specified
		if ($limit !== null) {
			// get one entry more than requested
			$limit += 1;
		}

		// split the string into words
		$words = $this->splitByRegex('/[^\\w\']+/u', $limit, PREG_SPLIT_NO_EMPTY);

		// if a limit has been specified
		if ($limit !== null) {
			// discard the last entry (which contains the remainder of the string)
			array_pop($words);
		}

		// return the words
		return $words;
	}
1153034
public static function sentences($count = 3)
    {
        $sentences = array();
        for ($i = 0; $i < $count; $i++) {
            $sentences[] = static::sentence();
        }

        return $sentences;
    }
1301565
public static function fromString($string, $default=true)
    {
        $array = array();

        foreach (preg_split('/\s+/', $string, -1, PREG_SPLIT_NO_EMPTY) as $token) {
            $fragments = explode("=", $token);
            $value = isset($fragments[1])
                ? trim($fragments[1],"' ") : $default;

            $array[$fragments[0]] = $value === 'null'
                ? null : $value;
        }

        return new self($array, $default);
    }
920681
function split($start, $length = null)
    {
        $return = clone $this;
        $path   = array_slice($this->getPath(), $start, $length);
        $return->setPath($path);

        return $return;
    }
1163879
public function trim($charlist = null)
    {
        return $this->cloneInstance(
            function (StringObject $new) use ($charlist) {
                $new->string = Mbstring::trim($new->string, $charlist);
            }
        );
    }
874859
public function trimEnd(array $chars = null){
		
		if($chars === null){
			return new static(\rtrim($this->_Value), $this->_Encoding);
		}
		
		$chars = \preg_quote(\implode(static::NONE, $chars));
		
		$str = \preg_replace(
				\sprintf('/[%s]+$/us', $chars),
				static::NONE,
				$this->_Value);
		
		return new static($str, $this->_Encoding);
		
	}
321953
public static String[] split(CharSequence self) {
        StringTokenizer st = new StringTokenizer(self.toString());
        String[] strings = new String[st.countTokens()];
        for (int i = 0; i < strings.length; i++) {
            strings[i] = st.nextToken();
        }
        return strings;
    }
696172
static public function keywords($value=null)
    {
        if ($value) {
            $value = StringHelper::str_cut(strip_tags($value), 100);
        }
        
        return static::input(trim($value));
    }
863904
public function split($delimiter = ' ') {
        $delimiter = (empty($delimiter)) ? ' ' : $delimiter;

        return explode($delimiter, $this->string);
    }
1156739
public function toStudlyCase(): Utility
    {
        $string = implode(' ', $this->prepareForCasing($this->string));

        $string = str_replace(' ', '', ucwords($string));

        return new static($string, $this->encoding);
    }
1156253
public function reverse()
    {
        return static::of(
            ArrayList::of($this->split())->reverse()->join(),
            $this->encoding
        );
    }
999399
public static String[] split(String str, char separator) {
    final int len;
    if (str == null 
        || ((len = str.length()) == 0)) {
      return null;
    }

    List<String> componentList = new ArrayList<String>();
    int startIndex = 0;

    for (int i = 0; i < len; i++) {
      if (str.charAt(i) == separator) {
        componentList.add(str.substring(startIndex, i));
        startIndex = i + 1;
      }
    }

    if (str.charAt(len - 1) != separator) {
      componentList.add(str.substring(startIndex, len));
    }

    return componentList.toArray(new String[componentList.size()]);
  }
277573
public function SplitLines()
    {
        if (!$value = $this->owner->value) {
            return;
        }
        $lines = ArrayList::create();
        foreach (preg_split("/\n|<br\/?>/", $value) as $line) {
            $lines->push(
                ArrayData::create(['Line' => $line])
            );
        }
        return $lines;
    }
389119
public static function split($event)
   {
      if (!is_string($event)) {
         throw new InvalidArgumentException(
            "invalid value provided for 'event'; expecting an event name ".
            "or event name and namespace as string"
         );
      }

      list($type, $namespace) = array_pad(explode('.', $event, 2), 2, null);
      return [ 
         ($type === '') ? null : $type,
         ($namespace === '') ? null : $namespace
      ];
   }
669192
protected function splitLastWord($string)
    {
        // see if we're dealing with a camelCase string
        if ($this->camelCased && preg_match('#^(.*)([A-Z].*)$#', $string, $matches)) {
            return [ $matches[1], '', $matches[2] ];
        }

        // otherwise, attempt to split at anything that might indicate a word separator
        if (preg_match('#^(.*)([_ \s-])([^_ \s-]+)$#', $string, $matches)) {
            return [ $matches[1], $matches[2], $matches[3] ];
        }

        return [ '', '', $string ];
    }
1082658
public static function splitQuery($string)
    {
        $queries = array();
        $current_query = '';
        $empty = true;

        $tokens = self::tokenize($string);

        foreach ($tokens as $token) {
            // If this is a query separator
            if ($token[self::TOKEN_VALUE] === ';') {
                if (!$empty) {
                    $queries[] = $current_query.';';
                }
                $current_query = '';
                $empty = true;
                continue;
            }

            // If this is a non-empty character
            if ($token[self::TOKEN_TYPE] !== self::TOKEN_TYPE_WHITESPACE && $token[self::TOKEN_TYPE] !== self::TOKEN_TYPE_COMMENT && $token[self::TOKEN_TYPE] !== self::TOKEN_TYPE_BLOCK_COMMENT) {
                $empty = false;
            }

            $current_query .= $token[self::TOKEN_VALUE];
        }

        if (!$empty) {
            $queries[] = trim($current_query);
        }

        return $queries;
    }
37819
public function shuffle()
    {
        $indexes = range(0, $this->length() - 1);
        shuffle($indexes);

        $shuffledStr = '';
        foreach ($indexes as $i) {
            $shuffledStr .= \mb_substr($this->str, $i, 1, $this->encoding);
        }

        return static::create($shuffledStr, $this->encoding);
    }