src/Str.php
public function first($length = null) {
		if ($length === null) {
			$length = 1;
		}

		$rawString = mb_substr($this->rawString, 0, $length, $this->charset);

		return new static($rawString, $this->charset);
	}
public function first($length = null) {
		if ($length === null) {
			$length = 1;
		}

		$rawString = mb_substr($this->rawString, 0, $length, $this->charset);

		return new static($rawString, $this->charset);
	}
public function first ( $ length = null ) { if ( $ length === null ) { $ length = 1 ; } $ rawString = mb_substr ( $ this -> rawString , 0 , $ length , $ this -> charset ) ; return new static ( $ rawString , $ this -> charset ) ; }
Returns the first character or the specified number of characters from the start of this string

@param int|null $length the number of characters to return from the start (optional)
@return static a new instance of this class
Returns the first character or the specified number of characters from the start of this string