From Bright Pattern Documentation
(Updated via BpDeleteTranslateTags script) |
|||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
− | + | = String Expressions= | |
In Bright Pattern Contact Center, you may work with data as variables stored as values, which may be specified as strings or expressions. A string is a sequence of characters that is generally understood as a data type; often a string is implemented as an array of bytes (i.e., words) that store a sequence of elements. An expression will produce a data type such as string. | In Bright Pattern Contact Center, you may work with data as variables stored as values, which may be specified as strings or expressions. A string is a sequence of characters that is generally understood as a data type; often a string is implemented as an array of bytes (i.e., words) that store a sequence of elements. An expression will produce a data type such as string. | ||
What follows is a list of tips regarding string expression structure. | What follows is a list of tips regarding string expression structure. | ||
− | * An expression starts with = sign, e.g. in "a=b" assignment block, ="string1"+"string2" in the value field would result in "string1string2". If you omit the equal sign, the result would be "string1"+"string2" | + | * An expression starts with <code>=</code> sign, e.g. in "a=b" assignment block, <code>="string1"+"string2"</code> in the value field would result in <code>"string1string2"</code>. If you omit the equal sign, the result would be <code>"string1"+"string2"</code> |
− | * Strings are enclosed in double quotes (e.g. | + | * Strings are enclosed in double quotes (e.g. <code>"sample string"</code>). |
− | * Backslash can be used to embed a double quote phrase within a string (e.g., | + | * Backslash can be used to embed a double quote phrase within a string (e.g., <code>"sample string \"embedded quote\" sample string"</code>). |
− | * Backslash can also be used to insert literal new-line and carriage-return symbols using the | + | * Backslash can also be used to insert literal new-line and carriage-return symbols using the <code>\n</code> and <code>\r</code> notation (e.g., <code>"sample string\n with new line in it"</code>). |
− | * Strings can be concatenated; that is, strings can be linked together as in a chain (e.g., | + | * Strings can be concatenated; that is, strings can be linked together as in a chain (e.g., <code>= "string 1" + "string2"</code> produces <code>"string1string2"</code>, or if <code>$(var1) = "help"</code> and <code>$(var2) = "me"</code> then <code>$(var1)$(var2)</code> returns <code>helpme</code>). |
− | * Strings themselves or string expressions cannot span multiple lines (i.e., while embedded, | + | * Strings themselves or string expressions cannot span multiple lines (i.e., while embedded, <code>\n</code> is OK, but the actual new line is not).</p> |
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 04:03, 29 May 2024
String Expressions
In Bright Pattern Contact Center, you may work with data as variables stored as values, which may be specified as strings or expressions. A string is a sequence of characters that is generally understood as a data type; often a string is implemented as an array of bytes (i.e., words) that store a sequence of elements. An expression will produce a data type such as string.
What follows is a list of tips regarding string expression structure.
- An expression starts with
=
sign, e.g. in "a=b" assignment block,="string1"+"string2"
in the value field would result in"string1string2"
. If you omit the equal sign, the result would be"string1"+"string2"
- Strings are enclosed in double quotes (e.g.
"sample string"
).
- Backslash can be used to embed a double quote phrase within a string (e.g.,
"sample string \"embedded quote\" sample string"
).
- Backslash can also be used to insert literal new-line and carriage-return symbols using the
\n
and\r
notation (e.g.,"sample string\n with new line in it"
).
- Strings can be concatenated; that is, strings can be linked together as in a chain (e.g.,
= "string 1" + "string2"
produces"string1string2"
, or if$(var1) = "help"
and$(var2) = "me"
then$(var1)$(var2)
returnshelpme
).
- Strings themselves or string expressions cannot span multiple lines (i.e., while embedded,
\n
is OK, but the actual new line is not).< Previous | Next >