STRING

This action performs the specified string operation on the source value, and the result is saved to the location that is specified in the destination pane. Several STRING functions have the parameter when in action.

The STRING action provides string operations. This action is user-extendable. This action calls a predefined Tcl procedure. The predefined Tcl procs are related to the STRING operation.

The Content area is used to present the statement to invoke the Tcl procedure. Double-clicking a Function entry appends the usage into the Content. After this, you edit the content of the statement according to the actual requirement.

Pausing the mouse on a function shows its usage. Double-clicking the function places it into the Content area.

This table shows the available STRING operations:

Operation Description
xlateStrConcat

Concatenates the source values as a string. Multiple source values are supported.

xlateStrIndex charIndex

Gets the string indicated by the index that is specified by the function parameter from the source value.

xlateStrLength

Gets the length of the source value as the string.

xlateStrMap ?nocase? mapping

Replaces the substring in the source value based on key-value pairs in mapping. mapping is a key value Tcl-style list.

If -nocase is specified, then matching is performed without regard to case differences.

xlateStrPadLeft/Right length ?padchar?

Pads the source value from left/right side with the character specified by padchar to the length.

If padchar is not specified, then whitespace is taken to fill.

xlateStrReplace first last ?newstring?

Removes a range of consecutive characters from the source value. This starts with the character whose index is first and ends with the character whose index is last. An index of 0 refers to the first character of the string.

If newstring is specified, then it is placed in the removed character range.

If first is greater than last or the length of the initial string, then the result is the same as the source value. This also happens when last is less than 0.

xlateStrSplit ?splitchar?

Splits the source value into several substrings by the separator that is specified by splitchar. The results are sequentially saved to the location that is specified by the destination pane.

If splitchar is not specified, then whitespace is taken by default.

xlateStrSubstring first last

Gets a range of consecutive characters from the source value. This starts with the character whose index is first and ends with the character whose index is last. An index of "0" refers to the first character of the string.

If first is greater than last, then an empty string is returned.

You can specify end to reach the end of the string. If first and last are not specified, then the range is from "0" to the end of the string.

xlateStrToLowercase/xlateStrToUppercase

Applies lowercase/uppercase to the source value, and saves the result to the location that is specified by the destination pane.

xlateStrTrim ?chars?

Gets a value equal to the source value, except that any leading or trailing characters present in the string given by chars are removed.

If chars is not specified, then white space is removed. This includes spaces, tabs, newlines, and carriage returns.

xlateTrimLeft/xlateStrTrimRight ?chars?

Gets a value equal to the source value, except that any leading/trailing characters present in the string given by chars are removed.

If chars is not specified, then white space is removed (spaces, tabs, newlines, and carriage returns).