Top

Name

trim — removes characters from both ends of string argument

Synopsis

trim ( str string ,
  trimchars string );
 

Description

trim returns a copy of subsequence of string str with all the characters present in trimchars trimmed off from the beginning. If the second argument is omitted, it is a space ' ' by default.

rtrim is similar except that it trims from the right.

trim trims from both ends.

concat('*',trim('   SIMURG   '),'*') -> '*SIMURG*'
ltrim('AbracadabrA','bAr')  -> 'acadabrA'
rtrim('AbracadabrA','bAr')  -> 'Abracada'
trim('AbracadabrA','bAr')    -> 'acada'