title | titleSuffix | description | author | ms.author | ms.reviewer | ms.service | ms.subservice | ms.topic | ms.devlang | ms.date | ms.custom |
---|---|---|---|---|---|---|---|---|---|---|---|
TRIM |
Azure Cosmos DB for NoSQL |
An Azure Cosmos DB for NoSQL system function that returns a string with leading or trailing whitespace trimmed. |
jcodella |
jacodel |
sidandrews |
cosmos-db |
nosql |
reference |
nosql |
02/27/2024 |
query-reference |
[!INCLUDENoSQL]
Returns a string expression after it removes leading and trailing whitespace or custom characters.
TRIM(<string_expr_1> [, <string_expr_2>])
Description | |
---|---|
string_expr_1 |
A string expression. |
string_expr_2 (Optional) |
An optional string expression with a string to trim from string_expr_1 . If not specified, the default is to trim whitespace. |
Returns a string expression.
This example illustrates various ways to trim a string expression.
:::code language="nosql" source="~/cosmos-db-nosql-query-samples/scripts/trim/query.sql" highlight="2-9":::
:::code language="json" source="~/cosmos-db-nosql-query-samples/scripts/trim/result.json":::
- This function doesn't use the index.