修剪函数

修剪函数可修剪所有前导和结尾空格,并将连续的一组空格字符替换为一个空格。

参数的字符串值为标准化,如以下步骤所述:
  1. 将所有制表符、回车符和换行替换为空格。
  2. 将连续的一系列空格减少到一个空格。
  3. 将结尾和前导空格除去。

参数:string

要修剪且标准化的字符串。这可以来自源节点、其他函数的结果或者您指定的值

返回:string

经过修剪且标准化后的参数。

示例:
输入字符串等于... 修剪函数返回...
'  The string to trim and  normalize. ' 'The string to trim and normalize.'
'           first line

                         second line

third line            '

'first line second line third line'