String Manipulation

This action defines how the values of selected variables should be formatted.

The most popular string manipulation actions are: delete leading and trailing spaces, search and replace characters, and delete opening and closing quotes.

This feature is often required is a trigger receives an unstructured data file or legacy data. in such cases, the data needs to be parsed using the Unstructured Data filter. String Manipulation action allows you to fine-tune the data value.

[Note] Note

If this action doesn't provide enough string manipulation power for a particular case, use Execute Script action instead to manipulate your data using Visual Basic Script or Python scripts.

UUID-e7689da1-7fbe-e698-af8e-884c627bf335.png

Variables group defines the variables whose values need to be formatted.

  • All variables: specifies all the defined variables in a data file to be formatted.

  • Selected variables: specifies a selection of variables to be formatted from the data file.

Format Text group defines string manipulation functions that apply to the selected variables or fields. Multiple functions can be used. The functions apply in the same order as seen in the editor – from top to bottom.

  • Delete spaces at the beginning: deletes all space characters (decimal ASCII code 32) from the beginning of the string.

  • Delete spaces at the end: deletes all space characters (decimal ASCII value 32) from the end of a string.

  • Delete opening closing characters: deletes the first occurrence of the selected opening and closing characters that is found in the string.

    Example 55. Example

    If using "{" as opening character and "}" as closing character, the input string {{selection}} is converted to {selection}.


  • Search and replace: executes standard search and replace function upon the provided values for find what and replace with. Regular expressions are supported.

[Note] Note

Several implementations of regular expressions are present. Loftware uses .NET Framework syntax for the regular expressions. For more information, see the Knowledge Base article.

  • Replace non printable characters with space: replaces all control characters in the string with "space" character (decimal ASCII code 32). Non printable characters are characters with decimal ASCII values between 0–31 and 127–159.

  • Delete non printable characters: deletes all control characters in the string. Non printable characters are characters with decimal ASCII values between 0–31 and 127–159.

  • Decode special characters: decodes the characters (or control codes) that are not available on the keyboard, such as Carriage Return or Line Feed. Loftware uses a notation to encode such characters in human-readable form, such as <CR> for Carriage Return and <LF> for Line Feed. This option converts special characters from Loftware syntax into actual binary characters.

    Example 56. Example

    When you receive the data "<CR><LF>", Designer uses it as plain string of 8 characters. You will have to enable this option to interpret and use the received data as two binary characters CR (Carriage Return – ASCII code 13) and LF (Line Feed – ASCII code 10).


  • Search and delete everything before: finds the provided string and deletes all characters in front of the defined string. The string can also be deleted.

  • Search and delete everything after: finds the provided string and deletes all characters behind the defined string. The string can also be deleted.

  • Change case: Changes all characters in your strings to uppercase or lowercase.