DMN String Functions

◷ Reading Time: 7 minutes

substring

Retrieves a substring from a string value. 1st place position is 1, last position is -1.

 substring (value, index, length)
  • value (string): a value to be used as source (Mandatory)
  • index (string): The one-based starting character position of a substring in this instance
  • length (int): The number of characters in the substring (optional)
Example: substring ('Substring this sentence', 1, 3)
Result: Sub
Example: substring ('01234', 3)
Result: 234
Example: substring("foobar",-2)
Result: "ar"

string length

Return number of characters (or code points) in string.

 string length (value,)
  • value (string): a value to be used as source (Mandatory)
Example: string length ('apple')
Result: 5
Example: string length ('11/23DavaneyAv')
Result: 14

upper case

Returns a copy of this string converted to uppercase.

 upper case (value)
  • value (string): the value to be converted to uppercase (Mandatory)
Example: upper case ('hello')
Result: HELLO
Example: upper case ('HeLlo')
Result: HELLO
Example: upper case ('hELlo123')
Result: HELLO123

lower case

Returns a copy of this string converted to lowercase.

 lower case (value)
  • value (string): the value to be converted to lowercase (Mandatory)
Example: lower case ('HeLlo')
Result: hello
Example: lower case ('HeLlo')
Result: hello
Example: lower case ('HeLlo123')
Result: hello123

substring before

Return substring of string before the match in string

 substring before (value, match)
  • value(string): a value to be used as source (Mandatory)
  • match: a part of value to match with (Mandatory)
Example: substring before ('foobar', 'bar')
Result: 'foo'
Example: substring before ('macdonald', 'na')
Result: 'macdo'

substring after

Return substring of string after the match in string

 substring after (value, match)
  • value(string): a value to be used as source (Mandatory)
  • match: a part of value to match with (Mandatory)
Example: substring after ('foobar', 'fo')
Result: 'obar'
Example: substring after ('macdonald', 'na')
Result: "ld"

replace

Regular expression pattern matching and replacement.

 replace (value, pattern, replacement, flags)
  • value: a value to be used as source (Mandatory)
  • pattern: the pattern identifies which substrings in the input string should be replaced. (Mandatory)
  • replacement: New string for the replacement
  • flags: Optional
Example: replace ('banana', 'a', 'o')
Result: bonono
Example: replace ('hello wOrld', '[aeiou]', '','i')
Result: hll wrld

contains

Check the string contain the match.

 contains (value, match)
  • value (string) : value to be checked (Mandatory)
  • match(string): the string to match with (Mandatory)
Example: contains ("foobar", "fo")
Result: True
Example: contains ('foobar','Smith')
Result: False

starts with

Determines whether the beginning of this string instance matches a specified string.

 starts with (value , match)
  • value (string) : value to be checked (Mandatory)
  • match(string): the starting string to match with (Mandatory)
Example: starts with ('hello world','hello')
Result: True
Example: starts with ('hello world', 'world')
Result: False
Example: starts with ('hello world','he')
Result: True

ends with

Determines whether the end of this string instance matches a specified string.

 ends with (value, match)
  • value (string) : value to be checked (Mandatory)
  • match(string): the ending string to match with (Mandatory)
Example: ends with ('hello world', 'world')
Result: True
Example: ends with ('hello world', 'hello')
Result: False
Example: ends with ('hello world', 'ld')
Result: True

matches

Determines whether a string matches a specific regular expression pattern.

 matches (value, pattern, plags)
  • value (string): Input string to check. If it is not a string, it will return false (Mandatory)
  • pattern (string): regexp pattern (Mandatory)
Example: matches ('foobar', '^fo*b')

Result: True
Example: matches ("test@gmail.com","\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*")

Result: True

split

Splits a string into substrings that are based on the characters in an array.

 split (value, splitter)
  • value (string): a value to be split (Mandatory)
  • splitter (string, array): splitter char, string or an array of multiple splitter (Mandatory)
Example: split ('Split this sentence into words', ' ')

Result: [
"Split",
"this",
"sentence",
"into",
"words"
]
Example: split ('a,b,c,d', ',')

Result: [
'a',
'b',
'c',
'd'
]

string join

Concatenates the elements of specified members of a collection/array, using the specified separator between each member. The output is a string.

 string join (value, splitter, trim)
  • value (string): a value to be split (Mandatory)
  • splitter (string): splitter char, string or an array of multiple splitter (optional)
Example: string join (["a", "b", "c"], "_and_ ")
Result: "a_and_b_and_c"
Example: string join (["a", "b", "c"])
Result: "abc"

 

Updated on September 12, 2025

Was this article helpful?

Related Articles