TRIM (Azure Cosmos DB)TRIM (Azure Cosmos DB)

返回删除前导空格和尾随空格后的字符串表达式。Returns a string expression after it removes leading and trailing blanks.

语法Syntax

TRIM(<str_expr>)  

参数Arguments

str_exprstr_expr
是一个字符串表达式。Is a string expression.

返回类型Return types

返回一个字符串表达式。Returns a string expression.

示例Examples

以下示例演示如何在查询中使用 TRIMThe following example shows how to use TRIM inside a query.

SELECT TRIM("   abc") AS t1, TRIM("   abc   ") AS t2, TRIM("abc   ") AS t3, TRIM("abc") AS t4

下面是结果集。Here is the result set.

[{"t1": "abc", "t2": "abc", "t3": "abc", "t4": "abc"}]  

备注Remarks

此系统函数不会使用索引。This system function will not utilize the index.

后续步骤Next steps