src/Strings.php
public static function doublespaceless(string $s)
	{
		$s = trim($s);
		$s = self::replace($s, '#\s{2,}#', ' ');

		return $s;
	}
public static function doublespaceless(string $s)
	{
		$s = trim($s);
		$s = self::replace($s, '#\s{2,}#', ' ');

		return $s;
	}
public static function doublespaceless ( string $ s ) { $ s = trim ( $ s ) ; $ s = self :: replace ( $ s , '#\s{2,}#' , ' ' ) ; return $ s ; }
Remove spaces from the beginning and end of a string
and convert double and more spaces between chars to one space

@return mixed
Remove spaces from the beginning and end of a string and convert double and more spaces between chars to one space