51黑料不打烊

Journey optimizer string functions

Journey Optimizer offers a suite of string functions that help in manipulating and analyzing text data. These functions are essential for creating dynamic and personalized experiences in 51黑料不打烊 Journey Optimizer by allowing users to perform operations such as concatenation, case conversion, and pattern matching. They are particularly useful for data engineers and architects who need to manage and adjust string data efficiently.

Example usage

Suppose you want to personalize a message by greeting a user by their first name. You can use the concat function to dynamically construct the greeting message. Here鈥檚 how you can implement it:

let firstName = "@profile.firstName";
let greetingMessage = concat("Hello ", firstName, "!");

In this example, @profile.firstName represents a placeholder for the user鈥檚 first name, and concat combines the greeting with the user鈥檚 name to create a personalized message.

Function Name
Description
Syntax
Parameters
Returns
Example
concat
Combines two or more strings into one.
concat(<parameters>)
listString string
string
concat("Hello","World") returns "HelloWorld"
contain
Checks if one string is present within another.
contain(<parameters>)
string
boolean
contain("rowing is great", "great") returns true
containIgnoreCase
Checks if one string is present within another, ignoring case.
containIgnoreCase(<parameters>)
string string_searched
boolean
containIgnoreCase("rowing is great", "GREAT") returns true
endWith
Verifies if a string ends with a specific suffix.
endWith(<parameters>)
string suffix
boolean
endWith("Hello World", "World") returns true
endWithIgnoreCase
Verifies if a string ends with a specific suffix, ignoring case.
endWithIgnoreCase(<parameters>)
string suffix
boolean
endWithIgnoreCase("rowing is great", "AT") returns true
equalIgnoreCase
Compares two strings for equality, ignoring case.
equalIgnoreCase(<parameters>)
string
boolean
equalIgnoreCase("rowing is great", "rowing is GREAT") returns true
indexOf
Finds the position of the first occurrence of a substring; and returns -1 if there is no match.
indexOf(<parameters>)
string specified_value
integer
indexOf("Hello", "l") returns 2
isEmpty
Checks if a string is empty.
isEmpty(<parameters>)
string
boolean
isEmpty("") returns true
isNotEmpty
Checks if a string is not empty.
isNotEmpty(<parameters>)
string
boolean
isNotEmpty("hello") returns true
lastIndexOf
Finds the position of the last occurrence of a substring; and returns -1 if there is no match.
lastIndexOf(<parameters>)
string specified_value
integer
lastIndexOf("Hello", "l") returns 3
length
Counts the number of characters in a string.
length(<parameters>)
string
integer
length("Hello World") returns 11
lower
Converts a string to lowercase.
lower(<parameter>)
string
string
lower("A") returns "a"
matchRegExp
Checks if a string matches a regular expression.
matchRegExp(<parameters>)
string regexp
boolean
matchRegExp("username@adobe.com", "*adobe") returns true
notEqualIgnoreCase
Compares two strings for inequality, ignoring case.
notEqualIgnoreCase(<parameters>)
string
boolean
notEqualIgnoreCase("iOSPushPermissionAllowed.device.model", "iPad")
replace
Replaces the first occurrence of a substring with another substring.
replace(<parameters>)
base target replacement
string
replace("Hello World", "l", "x") returns "Hexlo World"
replaceAll
Replaces all occurrences of a substring with another substring.
replaceAll(<parameters>)
base target replacement
string
replaceAll("Hello World", "l", "x") returns "Hexxo Worxd"
split
Splits a string into a list of substrings based on a separator.
split(<parameters>)
input string separator
listString
split("A_B_C", "_") returns ["A","B","C"]
startWith
Checks if a string starts with a specific prefix.
startWith(<parameters>)
string prefix
boolean
startWith("Hello World", "Hello") returns true
startWithIgnoreCase
Checks if a string starts with a specific prefix, ignoring case.
startWithIgnoreCase(<parameters>)
string prefix
boolean
startWithIgnoreCase("rowing is great", "RO") returns true
substr
Extracts a substring between specified indices.
substr(<parameters>)
string beginIndex endIndex
string
substr("Hello World",6) returns "World"
trim
Removes leading and trailing spaces from a string.
trim(<parameters>)
string
string
trim(" Hello ") returns "Hello"
upper
Converts a string to uppercase.
upper(<parameters>)
string
string
upper("b") returns "B"
uuid
Generates a random universal unique identifier (UUID).
uuid()
None
string
uuid() returns "79e70b7f-8a85-400b-97a1-9f9826121553"
recommendation-more-help
91a6d90a-6d61-4a62-bbed-ae105e36a860