for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace RoadBunch\StringBean;
class PrefixTrimmer extends AbstractFormatter
{
public function __construct(
private readonly string $prefix
) {}
public function format(string $string): string
if (str_starts_with($string, $this->prefix)) {
return ltrim(substr($string, strlen($this->prefix)));
}
return $string;