trim

Function trim 

Source
pub fn trim(args: &[Value]) -> Result<Value, RuntimeError>
Expand description

去除首尾空白字符

§功能

移除字符串开头和结尾的空白字符(空格、制表符、换行符等)。

§参数

  • string: String - 要处理的字符串

§返回值

String - 去除首尾空白后的字符串

§示例

Set text "  hello world  "
Set trimmed Trim(text)       # "hello world"
Set text "\t\ntest\n\t"
Set trimmed Trim(text)       # "test"