/**
 * Normalize white-spaces to a single space.
 *
 * @return self Returns instance of The Strings class.
 */
public function normalizeSpaces(): self

Examples

$string = Strings::create('SG-1  returns  from  an  off-world  mission')->normalizeSpaces();

echo $string;

The above example will output:

SG-1 returns from an off-world mission

Getting Started

Methods