Purpose

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

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

Details

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

However, the Result alway remains at 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 to define an additional pre-/postfix.

The radio-box Separator allows to define a separator which will be inserted between each pair of input-strings.

Compare Compare

The first two input strings are compared.

The field Case insensitive allows to turn of case-sensitivity (default is case-sensitive).

Make Lower Case MakeLowerCase The input string is converted to all lower case.
Make Upper Case MakeUpperCase The input string is converted to all upper case.
Replace Replace Inside the first string, all occurences 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 formated to a fix-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 input strings and prints them as unsigned numbers into the result string.

All but last numbers are appended with the currently selected separator string. Dependent 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 if string in a comparsion are equal.