LTRIM (NoSQL query)
APPLIES TO: NoSQL
Returns a string expression after it removes leading whitespace or specified characters.
LTRIM(<string_expr_1> [, <string_expr_2>])
Description | |
---|---|
string_expr_1 |
A string expression. |
string_expr_2 (Optional) |
An optional string expression to be trimmed from string_expr_1 . If not set, the default is to trim whitespace. |
Returns a string expression.
The following example shows how to use this function with various parameters inside a query.
SELECT VALUE {
whitespaceStart: LTRIM(" AdventureWorks"),
whitespaceStartEnd: LTRIM(" AdventureWorks "),
whitespaceEnd: LTRIM("AdventureWorks "),
noWhitespace: LTRIM("AdventureWorks"),
trimSuffix: LTRIM("AdventureWorks", "Works"),
trimPrefix: LTRIM("AdventureWorks", "Adventure"),
trimEntireTerm: LTRIM("AdventureWorks", "AdventureWorks"),
trimEmptyString: LTRIM("AdventureWorks", "")
}
[
{
"whitespaceStart": "AdventureWorks",
"whitespaceStartEnd": "AdventureWorks ",
"whitespaceEnd": "AdventureWorks ",
"noWhitespace": "AdventureWorks",
"trimSuffix": "AdventureWorks",
"trimPrefix": "Works",
"trimEntireTerm": "",
"trimEmptyString": "AdventureWorks"
}
]
- This function doesn't use the index.