共用方式為


STRINGTONULL - Cosmos DB 中的查詢語言 (在 Azure 和 Fabric 中)

函式會 STRINGTONULL 將字串運算式 null轉換為 。

STRINGTONULL 式會將字串運算式轉換成 null 適用於 NoSQL 的 Azure Cosmos DB。

語法

STRINGTONULL(<string_expr>)

Arguments

Description
string_expr 字串運算式。

傳回類型

傳回 null.

範例

本節包含如何使用此查詢語言建構的範例。

將字串轉換為 null

在此範例中,該 STRINGTONULL 函數用於將各種字串表達式 null轉換為 。

SELECT VALUE {
  parseNullString: STRINGTONULL("null"),
  parseWithPrefix: STRINGTONULL("null  "),
  parseWithSuffix: STRINGTONULL("  null"),
  parseWithWhitespace: STRINGTONULL("  null  "),
  parseUppercase: STRINGTONULL("NULL"),
  parseTitlecase: STRINGTONULL("Null"),
  parseNull: STRINGTONULL(null),
  parseUndefined: STRINGTONULL(undefined)
}
[
  {
    "parseNullString": null,
    "parseWithPrefix": null,
    "parseWithSuffix": null,
    "parseWithWhitespace": null
  }
]

備註

  • 此函式不會使用索引。
  • 如果運算式無法轉換,函式會傳回 undefined