public function title(bool
$allWords = false
):
static { $str =
clone $this;
$str->string =
$allWords ?
ucwords($str->string
) :
ucfirst($str->string
);
return $str;
} public function toUnicodeString(string
$fromEncoding = null
): UnicodeString
{ return new UnicodeString($this->
toCodePointString($fromEncoding)->string
);
} public function toCodePointString(string
$fromEncoding = null
): CodePointString
{ $u =
new CodePointString();
if (\
in_array($fromEncoding,
[null, 'utf8', 'utf-8', 'UTF8', 'UTF-8'
], true
) &&
preg_match('//u',
$this->string
)) { $u->string =
$this->string;
return $u;
}