Previous Up Next

5.2.5  Finding and removing leading/trailing whitespace

The trim command can find and/or remove leading and trailing whitespace in a string (see Section 21.2.2, Section 28.1.9 and Section 28.2.2 for other usages of trim).

Instead of trim, you can also use the strip command to remove whitespace, but note that it discards only space characters.

Examples

trim(" this is a string\n\t ")
     
“this is a string”           
trim(" this is a string\n\t ",right)
     
“ this is a string”           
trim(" 12345 ",index)
     
2,5           

Previous Up Next