Yosymfony\Spress\Core\Support\StringWrapper::deletePrefix PHP Method

deletePrefix() public method

Deletes a prefix of the string.
public deletePrefix ( string $prefix ) : string
$prefix string The prefix
return string The string without prefix
    public function deletePrefix($prefix)
    {
        if ($this->startWith($prefix) === true) {
            return substr($this->str, strlen($prefix));
        }
        return $this->str;
    }

Usage Example

 public function testDeletePrefix()
 {
     $str = new StringWrapper('Welcome to Spress');
     $this->assertEquals('to Spress', $str->deletePrefix('Welcome '));
     $this->assertEquals('Welcome to Spress', $str->deletePrefix('Hi'));
     $this->assertEquals('Welcome to Spress', $str->deletePrefix(''));
 }
All Usage Examples Of Yosymfony\Spress\Core\Support\StringWrapper::deletePrefix