method cleanSpaces documentation in bbn\Str
Trims, and removes extra spaces (all more than one)
Example
X::dump(Str::cleanSpaces(" Hello World\n\n\n (bool)! "));
// (string) "Hello World (bool)!"
function(string $st)
{
return trim(preg_replace('/\s+/', ' ', $st));
}
Trims, and removes extra spaces (all more than one) BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2025
BBN Solutions