src/Text.php
public function substring($start, $end = null) {
		$length = $this->length();
		if ($end < 0) {
			$end = $length + $end;
		}
		$end = $end !== null ? min($end, $length) : $length;
		$start = min($start, $end);
		$end = max($start, $end);
		$end = $end - $start;

		return new Text(mb_substr($this->string, $start, $end, $this->encoding), $this->encoding);
	}
public function substring($start, $end = null) {
		$length = $this->length();
		if ($end < 0) {
			$end = $length + $end;
		}
		$end = $end !== null ? min($end, $length) : $length;
		$start = min($start, $end);
		$end = max($start, $end);
		$end = $end - $start;

		return new Text(mb_substr($this->string, $start, $end, $this->encoding), $this->encoding);
	}
public function substring ( $ start , $ end = null ) { $ length = $ this -> length ( ) ; if ( $ end < 0 ) { $ end = $ length + $ end ; } $ end = $ end !== null ? min ( $ end , $ length ) : $ length ; $ start = min ( $ start , $ end ) ; $ end = max ( $ start , $ end ) ; $ end = $ end - $ start ; return new Text ( mb_substr ( $ this -> string , $ start , $ end , $ this -> encoding ) , $ this -> encoding ) ; }
Slices a piece of the string from a given start to an end.
If no length is given, the String is sliced to its maximum length.

@see #slice
@param int $start
@param int $end
@return Text
Slices a piece of the string from a given start to an end . If no length is given the String is sliced to its maximum length .