--- title: "Split text" slug: "core-split-string-resolver" updated: 2026-04-16T12:06:26Z published: 2026-04-16T12:06:26Z canonical: "docs.lobstersoftware.com/core-split-string-resolver" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # Split text > [!NOTE] > Value resolver – Abstract > > **Purpose:** Splits the text present as *input value* at each occurrence for the optionally parameterizable **Delimiter** (string or a **Regular** **expression**) and returns the resulting *substrings* as a list (`String[]`). > > > [!TIP] > > Tooltip > > > > - **Usage**: The parameterized **Delimiter** is searched for in a text passed as *input value* in order to split the text into *substrings*, which the value resolver returns as a list. > > - If there is no text as *input value*, the string image of the *input value* is processed. > > - If no **Delimiter** is specified, the text will be split into individual characters. > > - **Parameter**: > > - The **Delimiter** parameter is defined either by static text or by value resolvers. > > - Dependent on the **Regular expression?** option, the **Delimiter** is used either as a *regular expression* or as plain text (*default*) for the search in the *input value*. > > - **NOTE:** > > - Characters or strings evaluated as a **Delimiter** do not appear in the *substrings* in the return value. > > - If all characters from the *input value* are considered as a **Delimiter**, an empty list is returned. ![images/download/attachments/62867074/image2023-1-4_12-0-5-version-1-modificationdate-1672830005321-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2023-1-4_12-0-5-version-1-modificationdate-1672830005321-api-v2.png) The [Split text](/v1/docs/en/core-split-string-resolver) value resolver splits the text present as *input value* at each occurrence for the optionally parameterizable **Delimiter** (string or a **Regular expression**) and returns the resulting *substrings* as a list (`String[]`). The **Delimiter** can be defined either by direct input as static text or by value resolvers. Character (strings) evaluated as a **Delimiter** do not appear as part of the *substring* in the return value. Overall, the following special cases should be noted: - If the *input value* is "no value" (`$null`), the return value is also "no value" (`$null`). - If there is an *input value* that is not a text (`String`), then the *string image* of the *input value* is processed. - The *input value* is divided after each character if one of the following conditions is met: - "No value" (`$null`) was specified as the **Delimiter**. - An empty string ("") was specified as the **Delimiter**. - The value configuration for the **Delimiter** parameter returns "no value" (`$null`) or an empty string ("") at runtime. - If all characters from the *input value* are interpreted as a **Delimiter**, the value resolver returns an empty list (`[]`) and not a list with two empty strings. **WARNING:** If the **Regular expression?** option is selected, syntax errors may occur when interpreting the regular expression defined in the **Delimiter** parameter, which are handled as `ProcessException` by default. ## Configuration The text to be split is expected as *input value*. If the *input value* is not text (`String`), the *string image* of the *input value* is used. | Parameter | Description | Example | | --- | --- | --- | | **Separator** | By default, a text field is provided for the **Delimiter** for direct input of one or more text characters. The example on the right specifies a string of three characters `-` (space, minus, space) as the delimiter, which has been selected in the screenshot to highlight the spaces. An *input value* like `New York - Rio - Tokyo` is converted by this **Delimiter** into a list of three substrings (`New York`, `Rio`, `Tokyo`). | Direct input ![images/download/attachments/62867074/image2023-1-4_12-1-21-version-1-modificationdate-1672830081740-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2023-1-4_12-1-21-version-1-modificationdate-1672830081740-api-v2.png) | | Clicking on the small gray arrow at the bottom left switches from *direct entry* to *value configuration*, so that a value resolver or a chain of value resolvers can be configured to dynamically assign the **Delimiter** at runtime. In the example on the bottom right, a [Value from localization](/v1/docs/en/core-resource-resolver) value separator is used that refers to the **Bundle** `lobsterui` and the **Resource** `thousandsSeparator`. Obviously, the "thousands separator" defined as localization (in the [Localization](/v1/docs/en/core-localization-entry) or [Company specific localization](/v1/docs/en/core-owner-based-localization-overrides)) for the [Current locale](/v1/docs/en/core-current-locale-resolver) is used as a **Delimiter** here. An *input value* like `12.345.678` would be split into three substrings with digit groups (`12`, `345`, `678`) in a session in the [Locale](/v1/docs/en/core-locale) "German" (with default locale). To achieve the same result in a session with the [Locale](/v1/docs/en/core-locale) "English" (with default localization), the *input value* would have to be `12,345,678`. | Value configuration: (*directly after switching, still without configuration*) ![images/download/attachments/62867074/image2023-1-4_12-1-55-version-1-modificationdate-1672830115596-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2023-1-4_12-1-55-version-1-modificationdate-1672830115596-api-v2.png) Example: ![images/download/attachments/62867074/image2023-1-4_12-3-12-version-1-modificationdate-1672830192644-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2023-1-4_12-3-12-version-1-modificationdate-1672830192644-api-v2.png) | | **Regular expression?** | As long as the **Regular expression?** option is unchecked (default), input or resolved strings for the **Delimiter** parameter will be interpreted as plain text, as in the examples above. If the **Regular expression?** option is checked, then input or resolved strings for the **Delimiter** parameter will be interpreted as a *regular expression*. If *matches* are found in the *input value* for the parameterized expression, the *input* *value* is divided at the respective place where it was found. The sections evaluated as **Delimiters** are not included in the returned *substrings*. | Example: ![images/download/attachments/62867074/image2023-1-4_12-4-34-version-1-modificationdate-1672830274764-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2023-1-4_12-4-34-version-1-modificationdate-1672830274764-api-v2.png) The *regular expression* `[,.'\s]` defined by static direct input qualifies a set of separators to act as equal **Delimiters**. The *input values* like "12,345,678" and "12,345,678" (see previous example) or also `12 345 678` and `12'345'678` are thereby divided into the always same three groups of digits. **NOTE:** Since the `\s` character class covers all *whitespace* characters (not just the space character), a line break in the *input value*, for example, would also act as a **Delimiter**. | | **NOTE:** Of course, the string for the **Delimiter** parameter can also be defined by value configuration (see above) if the **Regular** **expression?** option is checked. Therefore, the *regular expression* can be defined dynamically at runtime (via value resolvers). | ## Examples ### Simple use case: "Parse" list entries from comma-separated text A comma-separated list of abbreviations for currencies should be able to be entered in a text field of an entity in order to list currencies that are "accepted" in the context of the business process concerned. - For example, an entry like `JPY,USD,EUR` should signal that Japanese Yen, US Dollar and Euro are "acceptable". In the context of an event handling, the entered text is "resolved" into a real list of single values, e.g. so that current exchange rates can be retrieved via a profile in the context of a loop. | In the **Resolver for entities** parameter of the [For each loop](/v1/docs/en/core-for-each-entity-actor) shown on the right, the [Split text](/v1/docs/en/core-split-string-resolver) value resolver is used to split the text that is to be directly available here as an *input value* for the loop and therefore also the value resolver. - The comma (,) is selected as **Delimiter** by direct input. - The **Regular expression?** option is not checked. In the action block, over which the loop iterates, a profile is called up that is supposed to call up the current exchange rate for the respective currency (e.g. via web service). For this purpose, the text key for the currency in question is required as a parameter. The further processing of the exchange rate data should not play a role here. Runtime example: An *input value* such as `PY,USD,EUR` triggers an iteration over the listed individual values and thus three profile calls with changing text parameters (`JPY`, `USD`, `EUR`). **NOTE:** The [Split text](/v1/docs/en/core-split-string-resolver) value resolver does not automatically "trim" the substrings, so an *input value* like "JPY, USD, EUR" (with space after the comma) could lead to difficulties unless the [Trim](/v1/docs/en/core-trim-string-resolver) value resolver is used in the profile call for the parameter. | ![images/download/attachments/62867074/image2023-1-4_12-5-38-version-1-modificationdate-1672830338646-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2023-1-4_12-5-38-version-1-modificationdate-1672830338646-api-v2.png) | | --- | --- | | The variant shown on the right uses the **Regular expression?** option and the *regular* *expression* `\s*` to define the **Delimiter** in such a way that all *whitespace* characters (spaces, line breaks) directly following the comma are interpreted (and therefore "eliminated" or "skipped") as part of the separator. Runtime example: An *input value* like `JPY,USD,EUR,CHF` returns the text keys `JPY`, `USD`, `EUR` and `CHF` in the iteration without unnecessary spaces. **NOTE:** Spaces at the beginning and at the end of the comma-separated list are not eliminated by this procedure! | ![images/download/attachments/62867074/image2023-1-4_12-6-16-version-1-modificationdate-1672830377080-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2023-1-4_12-6-16-version-1-modificationdate-1672830377080-api-v2.png) | ### More complex use case: "Resolve" components of a phone number The structure of a phone number in a text field is expected in the format `<country code>` (`<area code>`) `<connection>[-<extension>]`. In addition to digits, the individual components (`<>`) of the phone number should also be allowed to contain spaces and, with regard to the country code, the plus sign (`+`). In the context of event handling, these components are split and assigned to specific variables (`countryCode`, `areaCode`, `line`, `extension`). | The phone number to be split is passed as *input value* to the [For each loop](/v1/docs/en/core-for-each-entity-actor) shown on the right. For access within the loop it is stored in the `phoneNumber` variable. - The **Resolver for entities** here defines the variable names for the four components as a list of static text values (`String[]`) via a [Create list](/v1/docs/en/core-create-list-resolver) value resolver. - In the action block for the iteration, the assignment to the [Variable](/v1/docs/en/core-storage-value) whose name is the *reference object* for the iteration is made via the [Set value](/v1/docs/en/core-set-value-actor) value resolver. The [Object property](/v1/docs/en/core-property-resolver) value resolver in the **Variable name** parameter returns this name. - On the right side of the assignment, the `phoneNumber` variable is accessed to read out the component for the current iteration level through a value resolution chain: - The [Split text](/v1/docs/en/core-split-string-resolver) value resolver returns the list of all (existing) components at each iteration. The [^+\d ] **Delimiter** is interpreted as a **Regular** **expression** which evaluates all characters as separators which are not (`^`) digits (`\d`) or explicitly specified in the bracket expression (space, `+`). - A different value is drawn from the result of the split at each iteration, which is identified in the concatenated [List item](/v1/docs/en/core-list-item-resolver) value resolver by reference to the loop variable `$index` in the **Offset** parameter. - The final [Trim](/v1/docs/en/core-trim-string-resolver) value resolver removes marginal spaces for the component. These are qualified as non-separating characters in the *regular expression* for the **Delimiter** so that the digits of a component can be entered in a grouped manner (e.g. `32 16 8`). **NOTE:** Splitting the components works properly only under the assumption that the string in the `phoneNumber` variable does not "skip" any component in the schema and only the extension at the end is optional specification. **NOTE:** Considering performance, the [Split text](/v1/docs/en/core-split-string-resolver) value resolver should be placed before the loop to write the list of components into a variable. Then the splitting does not have to be repeated with each iteration. With consideration for the clearer representation (right) here it was renounced. | ![images/download/attachments/62867074/image2023-1-4_12-7-30-version-1-modificationdate-1672830450326-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2023-1-4_12-7-30-version-1-modificationdate-1672830450326-api-v2.png) | | --- | --- | Runtime example: The following component variables are set with the *input value* `+ 49 (89) 12 52 - 3210`: | Variable | Value | | --- | --- | | `countryCode` | `+49` | | `areaCode` | `89` | | `line` | `12 52` | | `extension` | `3210` | ### Special use case: Process components from the string image of an entity If there is no text as input value for the [Split text](/v1/docs/en/core-split-string-resolver) value resolver, the string image of the *input value* is processed as the text to be split. A string with the following structure is output for an *entity*: - `<id>:<entityClass>@<objectId>` Runtime example: *(String image for a user account with ID 1901)* - `1901:de.lobster.scm.base.security.user.User@510285c7` To identify an entity in a way that is readable by a user, e.g. in a notification, the ID of the entity (`<id>`) and the class (`<entityClass>`) or the localization for the class name are usually used. The ID of the Java object (@`<objectId>`), on the other hand, usually plays no role. The following example shows how the components of an entity's string image can be obtained and used to identify the entity (in this case, the [User of session](/v1/docs/en/base-session-user-value)) in a notification. | The [Execute with](/v1/docs/en/core-with-actor) event action shown already defines, via the **Object resolver** parameter as a *reference object*, the list of *substrings* obtained from the string image for the entity returned by the [User of session](/v1/docs/en/base-session-user-value): - The **Delimiter** parameter is to be interpreted as a **Regular expression**. It is defined as static text `[@:]`and classifies the characters `@` und : as alternative separators. - In the action part, a [Show alert](/v1/docs/en/freaction-show-alert) event action accesses the *substrings*, which the [Split text](/v1/docs/en/core-split-string-resolver) value resolver provides as a list (`String[]`): - The localization for the class name should appear in the **Title**. The [Value from localization](/v1/docs/en/core-resource-resolver) value resolver accesses the second *substring* in the *input* *value* (**Offset** 1) via a [List item](/v1/docs/en/core-list-item-resolver) value resolver to address the **Bundle** for the entity for whose **Resource** `$name` the localization is to be obtained. - The **Message** itself shall only name the ID of the entity which can be read as the first *substring* in the *input value* over a [List item](/v1/docs/en/core-list-item-resolver) value resolver with **Offset** 0. Runtime examples: ![images/download/attachments/62867074/image2023-1-4_12-20-19-version-1-modificationdate-1672831219983-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2023-1-4_12-20-19-version-1-modificationdate-1672831219983-api-v2.png) ![images/download/attachments/62867074/image2023-1-4_12-19-36-version-1-modificationdate-1672831176512-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2023-1-4_12-19-36-version-1-modificationdate-1672831176512-api-v2.png) **NOTE:** Of course, the type of account returned by the [User of session](/v1/docs/en/base-session-user-value) interface could also be determined via the variable `entityClass`, which the system automatically fills depending on the *reference object*. | ![images/download/attachments/62867074/image2023-1-4_12-9-7-version-1-modificationdate-1672830548046-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2023-1-4_12-9-7-version-1-modificationdate-1672830548046-api-v2.png) | | --- | --- |