StringSplit

MacroModule
genre Fields
author MeVis Medical Solutions AG
package MeVisLab/Standard
definition helpers.def
see also StringUtils, StringListSplitter
keywords tool

Purpose

The module StringSplit splits strings using arbitrary separator characters or even other strings.

In addition, special filters allow for selecting defined split results.

Usage

Fill the Input String field with the string that shall be split.

Fill the Separator Strings field with the characters or strings that shall be used as separators.

Details

The module splits the string in the Input String field into its components.

The separator characters or strings that shall be used can be defined using the Separator Strings field. If this field is left empty, all whitespaces are used as separator. It is not possible to combine whitespace and non-whitespace (e.g. a space and a letter) for use as separator. It is possible to use strings as separators.

The splitting results are written to the fields Substring n where n is a number in [0..11]. This means that only the first 12 results are considered. Any more results will be lost. The field Last Substring Found contains the last splitting result.

The field Selected Index allows for picking a splitting result substring by its index number. The specified substring is held in the field Selected Index Substring.

The box Search provides some options for searching the split substring results for a specified result. If the search was successful, the Search successful flag is set to true, the found substring is written to the field Finding and its index position to the field Finding Index. The Finding Index is -1 if the searching operation was not successful.

Windows

Default Panel

../../../Modules/Macros/Helpers/mhelp/Images/Screenshots/StringSplit._default.png

Parameter Fields

Visible Fields

Input String

name: inString, type: String

Sets the string to be split.

Separator Strings

name: separators, type: String, deprecated name: separator

Sets a list of separator strings to split the input string at.

Trim whitespace from results

name: trimWhitespace, type: Bool, default: TRUE

If checked, all whitespaces are trimmed from the resulting substrings.

Selected Index

name: selectedSubStringIndex, type: Integer, default: 0, minimum: 0, maximum: 11

Sets an index to a specific substring.

Selected Index Substring

name: selectedSubString, type: String, persistent: no

Shows th substring at the given Selected Index.

Last Substring Found

name: lastSubString, type: String, persistent: no

Shows the last found substring.

Search For

name: searchSubstring, type: String

Sets a string to search for in the results.

Search successful

name: searchResultFlag, type: Bool, persistent: no

Shows whether the search yielded a result.

Finding

name: searchResultString, type: String, persistent: no

Shows the search result. Case may differ from the search string, depending on Ignore case for search.

Finding Index

name: searchResultPosition, type: Integer, persistent: no

Shows the index of the substring that yielded the first search result or -1 if no string was found.