--- title: "Left trim" slug: "core-left-trim-resolver" updated: 2026-04-16T12:35:59Z published: 2026-04-16T12:35:59Z canonical: "docs.lobstersoftware.com/core-left-trim-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. # Left trim *See also:* [Trim](/v1/docs/en/core-trim-string-resolver), [Right trim](/v1/docs/en/core-right-trim-resolver) > [!NOTE] > **Value resolver – Abstract** > > **Purpose:** Removes leading *whitespace* characters from a string passed as *input value*. > > > [!TIP] > > Tooltip > > > > - **Usage**: The return value provides the string taken as *input value* without any leading *whitespace* characters. > > - **NOTE:** For *input values* that are not *strings*, their *string* mapping is processed. ![](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-C0NSMX2V.png) The [Left trim](/v1/docs/en/core-left-trim-resolver) value resolver removes leading *whitespace* characters from a string passed as *input value*. - If no value (`$null`) is present as *input value*, no value (`$null`) is returned. - For *input values* that are not *strings*, their *string* mapping is processed. ## Configuration The [Left trim](/v1/docs/en/core-left-trim-resolver) value resolver expects a string as *input value* and does not use any parameters. ## Example Within an event handler, a list of [Addresses](/v1/docs/en/base-address) is processed in a [For each loop](/v1/docs/en/core-for-each-entity-actor) event action. In this case, information for the "Country" (`countryCode`) and "Zip code" (`zipcode`) fields should be combined into a common string according to the following logic: ```plaintext [countryCode-]zipcode ``` - The two-character country code (ISO-3166 alpha-2) should therefore appear separated from the Zip code by a minus sign if the address specifies a [Country](/v1/docs/en/core-country). - If the [Country](/v1/docs/en/core-country) is not specified, only the Zip code should appear without a prefix. Runtime example: | - The first example address uses "Germany" (`DE`) as the country. - The second sample address does not specify a country. The output string appears without a preceding minus sign. **NOTE:** It is assumed in the example that the list does not contain any addresses without a Zip code, so that this special case does not have to be considered. | ![images/download/attachments/106958174/image2022-6-29_16-34-55-version-1-modificationdate-1656513295637-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2022-6-29_16-34-55-version-1-modificationdate-1656513295637-api-v2.png) | | --- | --- | Configuration: | The screenshot on the right shows a section of the [For each loop](/v1/docs/en/core-for-each-entity-actor) event action block, which processes a list of [Addresses](/v1/docs/en/base-address) step by step. For each iteration, exactly one address is available as a *reference* *object*, which is available as an *input value* for value resolvers in the context of the mapped [Show alert (Popup)](/v1/docs/en/core-popup-actor) event action. The content of the **Message** is obtained from the address in the *input value* by a chain of value resolvers: - In the first step, a [Concat strings](/v1/docs/en/core-concat-string-resolver) value resolver concatenates the values of the `countryCode.name` and `zipcode` fields, inserting a space character as a separator (see second *substring*). At first, it does not matter whether these fields are filled or empty. - If no "country" is specified for an address, the first substring `countryCode.name` returns no value. Then the string passed to the following [Left trim](/v1/docs/en/core-left-trim-resolver) value resolver starts with statically defined blank characters, which are then removed. - The *input value* for the third step of the chain is then a string that contains a space character only if this separates "country" and "Zip code" from each other. The [Replace text](/v1/docs/en/core-replace-string-resolver) value resolver replaces this space with a minus sign. **NOTE:** The solution assumes that neither the "country codes" (`countryCode.name`) stored in the dynamic enumeration [Country](/v1/docs/en/core-country) nor the Zip codes entered in addresses can contain a space character. Otherwise these are also replaced by minus signs. | ![images/download/attachments/106958174/image2022-6-29_17-16-38-version-1-modificationdate-1656515798873-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2022-6-29_17-16-38-version-1-modificationdate-1656515798873-api-v2.png) | | --- | --- | | **NOTE:** Instead of the space character, it would also be possible to use the minus sign directly as a separator in the [Concat strings](/v1/docs/en/core-concat-string-resolver) value resolver here. The [Left trim](/v1/docs/en/core-left-trim-resolver) value resolver would then be pointless. And the [Replace text](/v1/docs/en/core-replace-string-resolver) value resolver would then have to take over its function for the special case "no country selected" and remove the leading minus sign, if any. A very simple regular expression makes this possible: - **Search text:** `^-` - **Replace with**: *blank character string ("")* - **Regular expression?**: ![images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/check.svg](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/check(33).svg) | ![images/download/attachments/106958174/image2022-6-29_17-17-37-version-1-modificationdate-1656515857896-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2022-6-29_17-17-37-version-1-modificationdate-1656515857896-api-v2.png) |