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 single concat statement. When you have multiple strings to concatenate, you can click choose term in an expression term and select Insert Above or Remove to move that field around or remove it.

The string to append

endsWith

Returns True if the original string ends with the specified string.

Note:

The specified string is case-sensitive.

The specified string to check if the original string ends with.

equals

Returns True if the string equals the specified string.

The specified string to check if the original string equals.

greaterThan

Returns True if the string value is greater than the specified value (both must be same data type).

The specified string to check if the original string is greater than.

greaterThanOrEqual

Returns True if the string value is greater than or equal to the specified value (both must be same data type).

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 indexOf method returns an integer, which cannot be used directly as a return value. You can use this integer to determine the starting place for a substring. See Integer and Float.

The string that you want to find the starting position for.

IsEmpty

Returns True if the property contains either a null value or an empty string.

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 length attribute is an integer. See Integer and Float.

No parameters required

lessThan

Returns True if the string value is less than the specified value (both must be same data type).

The specified string to check if the original string is less than.

lessThanOrEqual

Returns True if the string value is less than or equal to the specified value (both must be same data type).

The specified string to check if the original string is less than or equal to.

matches

Returns True if the string matches the specified Java regular expression.

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: a(b|c)d searches for the pattern: a, followed by either b or c, then followed by d. This regular expression matches both abd and acd.

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 for Corporate 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, .*Corporate.* will match with Corporate Planning.

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, return node.properties.Core.Description.orElse('Default Descr') will return "Default Descr" if the Core.Description property for a node is null.

replace

Replaces all instances of an old string with a new string

  • The original string to search for

    Note:

    You can use a Java regular expression to identify the string pattern to search for.
  • The string to replace the original string with
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.

  • True: Allow blank values to be included in the resulting string list.
  • False (default): Blank values are excluded from the resulting string list.

For example, for the string A//C, if Include Blanks is enabled, the string list will have three entries: A, (blank value), C. If it is disabled, the string list will have two entries: A and C.

startsWith

Returns True if the original string begins with the specified string.

Note:

The specified string is case-sensitive.

The specified string to check if the original string begins with.

substring

Returns part of a string.

  • The starting position
  • The number of characters to return
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:

Trim will also remove whitespace characters, such as Tabs and Carriage Returns.

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.


screenshot contains an expression as described in the next paragraph

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.