DataPrime 字串函數

本指南提供 IBM® Cloud Logs DataPrime 字串函數的詞彙。

chr

以單一字元字串傳回 Unicode 代碼點編號。

chr(number: number): string

codepoint

返回字串中唯一字元的 Unicode 代碼點。

codepoint(string: string): number

concat

將多個字串串接為一個字串。

concat(value: string, ...values: string): string

contains

如果子串包含在字串中,返回 true

contains(string: string, substring: string): bool

endsWith

如果字串以後綴結尾,則返回 true

endsWith(string: string, suffix: string): bool

indexOf

返回子串在字串中的位置,若未找到,則返回 -1。

indexOf(string: string, substring: string): number

length

回傳值的長度

length(value: string): number

ltrim

移除字串值左側的空白

ltrim(value: string): string

matches

評估正規表示式樣式,並判斷它是否包含在字串中。

matches(string: string, regexp: regexp): bool

pad

左側墊字符串到 charCount。 如果 size < fillWith.length() 是字串,結果會被截斷。 請參閱 padLeft 瞭解更多詳細資訊。 padLeft 的別名。

pad(value: string, charCount: number, fillWith: string): string

padLeft

padLeft(value: string, charCount: number, fillWith: string): string

左側墊字符串到 charCount。 如果 size < fillWith.length() 是字串,結果會被截斷。

padRight

右側墊串到 charCount。 如果 size < fillWith.length() 是字串,結果會被截斷。

padRight(value: string, charCount: number, fillWith: string): string

regexpSplitParts

根據 regexp 分隔符分割字串,並返回索引處的欄位。 索引以 1 開始。

regexpSplitParts(string: string, delimiter: regexp, index: number): string

rtrim

移除字串值右方的空白。

rtrim(value: string): string

splitParts

根據分隔符分割字串,並返回索引處的欄位。 索引以 1 開始。

splitParts(string: string, delimiter: string, index: number): string

startsWith

如果字串以前綴開頭,則返回 true。

startsWith(string: string, prefix: string): bool

substr

Returns the substring in value, from position from and up to length length.

substr(value: string, from: number, length: number?): string

toLowerCase

將值轉換為小寫。

toLowerCase(value: string): string

toUpperCase

將值轉換為大寫。

toUpperCase(value: string): string

trim

移除字串值邊緣的空白。

trim(value: string): string

字串插補

  • this is an interpolated {$d.some_keypath} string- {$d.some_keypath} 將被方括號所括住的已評估的表達式取代。

  • this is how you escape \{ and \} and \` - 向後斜線 \ 用於轉義用於關鍵路徑的 { 和 } 等字元。