public function replaceNonAlpha(string $replacement = '', bool $strict = false): Utility
    {
        if ($strict) {
            $pattern = '/[^a-zA-Z]/';
        } else {
            $pattern = '/[^a-zA-Z ]/';
        }

        $string = preg_replace($pattern, $replacement, trim($this->string));

        return new static($string, $this->encoding);
    }
public function replaceNonAlpha(string $replacement = '', bool $strict = false): Utility
    {
        if ($strict) {
            $pattern = '/[^a-zA-Z]/';
        } else {
            $pattern = '/[^a-zA-Z ]/';
        }

        $string = preg_replace($pattern, $replacement, trim($this->string));

        return new static($string, $this->encoding);
    }
public function replaceNonAlpha ( string $ replacement = '' , bool $ strict = false ) : Utility { if ( $ strict ) { $ pattern = '/[^a-zA-Z]/' ; } else { $ pattern = '/[^a-zA-Z ]/' ; } $ string = preg_replace ( $ pattern , $ replacement , trim ( $ this -> string ) ) ; return new static ( $ string , $ this -> encoding ) ; }
Replace none alpha characters in the string with the given value

@param string $replacement Value to replace none alpha characters with
@param boolean $strict Should spaces be preserved

@return $this
Replace none alpha characters in the string with the given value