String package
Use the String package to perform various operations such as comparing two strings, retrieving the string length, or converting a string to uppercase or lowercase.
Actions in the String package
The String package includes the following actions:
Action | Description |
---|---|
Assign | Assigns or concatenates strings.
|
Compare | Compares two strings.
|
Extract text | See Using the Extract text action. |
Evaluate variable | Compares the user-specified string variable with the string
variables in the bot and if a match is found, the
action returns the value of the matching variable.
Example:
Note: This action
can evaluate only string variables and up to one level
of nesting. |
Find | See Using Find action. |
Generate random string | Generates a string of uppercase and lowercase alphanumeric
characters and assigns it to a string variable.
|
Import string from text file | Imports values from a variable in a text file into a string variable.
Note: If you built a bot using this action from the
String
package from Build 5322 or earlier, the action will be missing when you open the bot with the default package
version. You must reinsert the action and
repopulate the fields. |
Length | Retrieves the string length.
|
Lowercase | Converts the source string to lowercase.
|
Replace | See Using Replace action. |
Reverse | Reverses the source string.
|
Split | See Using Split action. |
Substring | Extracts a substring from a string.
|
To boolean | Converts a string to a Boolean.
|
To locale number | Converts a string to a locale-formatted number.
You can also use the action in an expression. For example, $prompt-assignment.String:toLocaleNumber("en-US")$. |
To number | Converts a string to a number. This action
supports positive, negative, and decimal numbers. Note: If the
string contains commas, remove them by using the
Replace
action to replace each comma with an empty
string.
|
Trim | Trims blanks and whitespaces from a string.
|
Uppercase | Converts the source string to uppercase.
|