mirror of
https://github.com/danielstjules/Stringy.git
synced 2025-08-13 00:34:11 +02:00
@@ -379,11 +379,17 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function tidy()
|
public function tidy()
|
||||||
{
|
{
|
||||||
$str = $this->str;
|
$str = preg_replace(array(
|
||||||
$str = preg_replace('/\x{2026}/u', '...', $str);
|
'/\x{2026}/u',
|
||||||
$str = preg_replace('/[\x{201C}\x{201D}]/u', '"', $str);
|
'/[\x{201C}\x{201D}]/u',
|
||||||
$str = preg_replace('/[\x{2018}\x{2019}]/u', "'", $str);
|
'/[\x{2018}\x{2019}]/u',
|
||||||
$str = preg_replace('/[\x{2013}\x{2014}]/u', '-', $str);
|
'/[\x{2013}\x{2014}]/u',
|
||||||
|
), array(
|
||||||
|
'...',
|
||||||
|
'"',
|
||||||
|
"'",
|
||||||
|
'-',
|
||||||
|
), $this->str);
|
||||||
|
|
||||||
return self::create($str, $this->encoding);
|
return self::create($str, $this->encoding);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user