RTRIM (NoSQL query)

APPLIES TO: NoSQL

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

Syntax

RTRIM(<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: RTRIM("  AdventureWorks"), 
    whitespaceStartEnd: RTRIM("  AdventureWorks  "), 
    whitespaceEnd: RTRIM("AdventureWorks  "), 
    noWhitespace: RTRIM("AdventureWorks"),
    trimSuffix: RTRIM("AdventureWorks", "Works"),
    trimPrefix: RTRIM("AdventureWorks", "Adventure"),
    trimEntireTerm: RTRIM("AdventureWorks", "AdventureWorks"),
    trimEmptyString: RTRIM("AdventureWorks", "")
}
[
  {
    "whitespaceStart": "  AdventureWorks",
    "whitespaceStartEnd": "  AdventureWorks",
    "whitespaceEnd": "AdventureWorks",
    "noWhitespace": "AdventureWorks",
    "trimSuffix": "Adventure",
    "trimPrefix": "AdventureWorks",
    "trimEntireTerm": "",
    "trimEmptyString": "AdventureWorks"
  }
]

Remarks

  • This function doesn't use the index.