| copyright |
|
||
|---|---|---|---|
| lastupdated | 2025-10-17 | ||
| keywords | |||
| subcollection | cloud-logs |
{{site.data.keyword.attribute-definition-list}}
{: #dataprime-ref-str-func}
This guide provides a glossary of {{site.data.keyword.logs_full}} DataPrime string functions. {: shortdesc}
{: #chr}
Returns the Unicode code point number as a single character string.
chr(number: number): string
{: codebock}
{: #codepoint}
Returns the Unicode code point of the only character of string.
codepoint(string: string): number
{: codeblock}
{: #concat}
Concatenates multiple strings into one.
concat(value: string, ...values: string): string
{: codeblock}
{: #contains}
Returns true if substring is contained in string
contains(string: string, substring: string): bool
{: codeblock}
{: #endswith}
Returns true if string ends with suffix
endsWith(string: string, suffix: string): bool
{: codeblock}
{: #indexof}
Returns the position of substring in string, or -1 if not found.
indexOf(string: string, substring: string): number
{: codeblock}
{: #length}
Returns the length of value
length(value: string): number
{: codeblock}
{: #ltrim}
Removes whitespace to the left of the string value
ltrim(value: string): string
{: codeblock}
{: #matches}
Evaluates the regular expression pattern and determines if it is contained within string.
matches(string: string, regexp: regexp): bool
{: codeblock}
{: #pad}
Left pads string to charCount. If size < fillWith.length() of string, result is truncated. See padLeft for more details. Alias for padLeft.
pad(value: string, charCount: number, fillWith: string): string
{: codeblock}
{: #padleft}
padLeft(value: string, charCount: number, fillWith: string): string
{: codeblock}
Left pads string to charCount. If size < fillWith.length() of string, result is truncated.
{: #padright}
Right pads string to charCount. If size < fillWith.length() of string, result is truncated.
padRight(value: string, charCount: number, fillWith: string): string
{: codeblock}
{: #regexpsplitparts}
Splits string on regexp-delimiter, returns the field at index. Indexes start with 1.
regexpSplitParts(string: string, delimiter: regexp, index: number): string
{: codeblock}
{: #rtrim}
Removes whitespace to the right of the string value.
rtrim(value: string): string
{: codeblock}
{: #splitparts}
Splits string on delimiter, returns the field at index. Indexes start with 1.
splitParts(string: string, delimiter: string, index: number): string
{: codeblock}
{: #startswith}
Returns true if string starts with prefix.
startsWith(string: string, prefix: string): bool
{: codeblock}
{: #substr}
Returns the substring in value, from position from and up to length length.
substr(value: string, from: number, length: number?): string
{: codeblock}
{: #tolowercase}
Converts value to lowercase.
toLowerCase(value: string): string
{: codeblock}
{: #touppercase}
Converts value to uppercase.
toUpperCase(value: string): string
{: codeblock}
{: #trim}
Removes whitespace from the edges of a string value.
trim(value: string): string
{: codeblock}
{: #string-interpolation}
-
this is an interpolated {$d.some_keypath} string–{$d.some_keypath}will be replaced with the evaluated expression that is enclosed by the brackets. -
this is how you escape \{ and \} and \`– The backward slash\is used to escape characters such as{and}that are used for keypaths.