<?php
use function Stringy\create as s;
dump(
(string) s('too much space...')
->replace('too', 'not')
->collapseWhitespace(),
(string) s('shout ')
->repeat(2)
->toUpperCase()
->append('let it all out'),
s('òçå')->getEncoding()
);
foreach(s('text') as $char) {
echo $char . PHP_EOL;
}
$text = 'öńšç';
dump(strlen($text), s($text)->length());
^ "not much space..."
^ "SHOUT SHOUT let it all out"
^ "UTF-8"
^ 8
^ 4