trim()

trim entfernt Leerzeichen am Anfang und am Ende und gibt den restlichen Text zurück:

trim(" Hallo Welt   ") - liefert "Hallo Welt"