संपादित करें

इसके माध्यम से साझा किया गया


LTRIM (NoSQL query)

APPLIES TO: NoSQL

Returns a string expression after it removes leading whitespace or specified characters.

Syntax

LTRIM(<string_expr_1> [, <string_expr_2>])  

Arguments

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.

Return types

Returns a string expression.

Examples

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"
  }
]

Remarks

  • This function doesn't use the index.