Description
Hi, I would be great to have a method to replace strings only at the start/end of the string.
This is currently possible with
if ($path->startsWith($basePath))
{
$path = $path->slice($basePath->length())->prepend("...");
}
but that is a common enough task to warrant a separate function for, imo.
Example
$baseDir = __DIR__;
$possiblyRelative = $path->replaceStart($baseDir, ".");
(names tbd)