pyspark.sql.functions.
trim
Trim the spaces from both ends for the specified string column.
New in version 1.5.