Strings, Numeric Strings, and Sequences
Strings in expressions include fields like property names and descriptions, as well as literal values. After you select a string in an expression, there are several methods and attributes that you can select for that string. For example, you can concatenate a node's name and description and use the resulting string in an Alias property, or you can return just a portion of a source string by using the substring method.
Numeric strings and sequence data types are strings that support numeric values only (0-9). They are limited to 40 characters.
You can add literal values to string data types. See Working with Literal Values.
Many of the string methods require you to enter additional parameters. The expression
builder creates a new expression term for those parameters when you select that
method. For example, when you select a concat
method, one
additional expression term is added for you to specify the string to append. When
you select a replace
method, two additional expression terms are
added for you to specify the text to search for and the text to replace it with.
The following table describes the methods and attributes that you can use to manipulate string values in the expression builder, as well as the parameters for those fields.
Method or Attribute | Usage | Parameters |
---|---|---|
Concat |
Concatenates (or appends) two or more string fields together and returns the combined string as the result. Note: You can append multiple strings in a singleconcat statement. When you have multiple
strings to concatenate, you can click in an expression term and select Insert
Above or Remove to move
that field around or remove it.
|
The string to append |
endsWith |
Returns Note: The specified string is case-sensitive. |
The specified string to check if the original string ends with. |
equals |
Returns |
The specified string to check if the original string equals. |
greaterThan |
Returns |
The specified string to check if the original string is greater than. |
greaterThanOrEqual |
Returns |
The specified string to check if the original string is greater than or equal to. |
indexOf |
Returns the starting position of the specified string in the original string. Note: The |
The string that you want to find the starting position for. |
IsEmpty |
Returns |
No parameters required |
isNull |
Returns True if the string property contains a
null value.
|
No parameters required |
length |
Counts the number of characters in a string The |
No parameters required |
lessThan |
Returns |
The specified string to check if the original string is less than. |
lessThanOrEqual |
Returns |
The specified string to check if the original string is less than or equal to. |
matches |
Returns Tip: Regular expressions specify patterns to search for in string data using standardized syntax conventions. A regular expression, or regex, can specify complex patterns of character sequences. For example, the following regular expression:
|
The specified Java regular expression to check if the original string matches. Note: Java regular expressions perform complete matches on strings, not partial matches. So, if you are searching forCorporate in an application name, an
application with the name Corporate Planning
would not be a match.
Use wildcards before and after a string
to search for partial matches. For example,
|
orElse |
Returns a specified value if the preceding expression term has a null value. |
The value to return if the preceding expression term is null. For example, |
replace |
Replaces all instances of an old string with a new string |
|
split |
Splits a string into a list of strings based on the specified delimiter. Note: See List and String List for the methods that you can add to a string list. |
The delimiter to split the string on Include Blanks: Specify whether or not blank values should be included as list items in the resulting string list.
For example, for the string |
startsWith |
Returns Note: The specified string is case-sensitive. |
The specified string to check if the original string begins with. |
substring |
Returns part of a string. |
|
toDate |
Converts a string value into a date value |
The date format (for example, (MM/dd/yyyy). See Date and Time Formatting Symbols for date and time formatting. |
toFloat |
Converts a string value into a float value |
No parameters required |
toInteger |
Converts a string value into an integer value. |
No parameters required |
toLowerCase |
Returns a string in all lowercase. |
No parameters required |
toUpperCase |
Returns a string in all uppercase. |
No parameters required |
trim |
Returns a string with leading and trailing spaces removed. Note:
|
No parameters required |
For greaterThan
, greaterThanOrEqual
,
lessThan
, and lessThanorEqual
, the string is
sorted by the first character, then the second character, and so on. When comparing,
0-9 is less than A-Z.
Examples:
- A < AA
- AA > B
- 11 < 2
- A > 1
You can combine string methods and attributes in your expression. For example, the following string searches for the @ character in a node's description and returns everything after that character.
In this example, the first expression term is a substring
expression, which requires two parameters: a starting position, and the number of
characters to return.
- For the starting position expression term, we selected an
indexOf
method with a parameter of "@". This will search the description field for the @ sign and return the integer value of where that sign is located as the starting position. - For the number of characters to return expression term, we selected a
length
attribute. This ensures that however long the string is, the full value after the @ sign will be returned because the number of characters is equal to the length of the complete string.