StringUtils

MLModule

genre

Fields

author

MeVis Medical Solutions AG

package

MeVisLab/Standard

dll

MLMiscModules

definition

MLMiscModules.def

see also

StringSplit

keywords

concat, trim, format, search, find, replace, character, concatenate, lower, upper, case, reverse, string, substring, ascii, prefix, postfix, parse

Purpose

The module StringUtils offers a collection of general purpose operations on strings.

All operations work on the module’s fields. No scripting is used inside this module.

Details

Depending on the selected Operation, the GUI shows different input and option fields.

However, the Result always remains in the same place.

Windows

Default Panel

../../../Modules/ML/MLMiscModules/mhelp/Images/Screenshots/StringUtils._default.png

Parameter Fields

Visible Fields

Operation

name: operationType, type: Enum, default: Concatenate

Defines the string operation.

Values:

Title

Name

Description

​Concatenate

​Concatenate

​Up to six input strings may be concatenated.

Each one may be toggled on or off through a checkbox (by default, the first two strings are active, while the other four are inactive).

At the end of each line, an integer field refers to the length of the input strings. Only active strings will be considered for concatenation.

The checkboxes Prefix and Postfix allow for defining an additional pre-/postfix.

The radiobutton group Separator allows for defining a separator that will be inserted between each pair of input strings.

​Compare

​Compare

​The first two input strings are compared.

The field Case insensitive allows for turning off case-sensitivity (default is case-sensitive).

​Make Lower Case

​MakeLowerCase

​The input string is converted to all lowercase.

​Make Upper Case

​MakeUpperCase

​The input string is converted to all uppercase.

​Replace

​Replace

​Inside the first string, all occurrences of the second string are replaced by the third string.

​Reverse

​Reverse

​The character sequence in the input string is reversed.

​Substring

​Substring

​From the input string, a substring is extracted in the range of From to To.

If either of these values exceeds the length of the input-string, the operation will use the largest possible value.

​Format Float

​FormatFloat

​A floating-point input string is formatted to a fixed-point number.

The number of decimal digits is defined in the precision field (internally limited to 32 digits). Valid input strings have the following form:

[whitespace] [sign] [digits] [.digits] [ { e | E }[sign]digits]

For invalid input strings, the result will be zero.

​To ASCII

​ToASCII

​Takes all ASCII character values from the input strings and prints them as unsigned numbers into the result string.

All but last numbers are appended with the currently selected separator string. Depending on the UseHex flag, the numbers are printed as hexadecimal or as decimal numbers.

If UseHexPrefix is checked, hexadecimal numbers are prefixed additionally with 0x.

Result

name: result, type: String, persistent: no

Shows the resulting string of any operation.

Length Result

name: lengthResult, type: Integer, persistent: no

Shows the length of the resulting string.

Equal?

name: boolResult, type: Bool, persistent: no

Shows whether the strings in a comparison are equal.