remove—the default is whitespace (space, tab, newline, carriage return). Example of trimming vowels: set string onomatopoeia set trimmed [string trim $string aeiou] ;# result is nomatop set r_trimmed [string trimright $string aeiou] ;# result is onomatop set l_trimmed [string trimleft $string aeiou] ;# result is nomatopoeia XSLT XSLT includes the function normalize-space(string) which strips leading and trailing whitespace, in addition to replacing any whitespace sequence (including line breaks) with a single space. Example: <xsl:variable name='trimmed'> <xsl:value-of select='normalize-space(string)'/> </xsl:variable> XSLT 2.0 includes regular expressions, providing another mechanism to perform string trimming. Another XSLT technique for trimming is to utilize the XPath 2.0 substring() function. References String functions Programming language comparison Articles with example Python (programming language) code