Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

StrSplit

  • Last UpdatedJul 18, 2023
  • 1 minute read

Splits a string into sub-strings based on the specified delimiter. Sub-strings are stored in a new array and a handle to this array is returned. The returned array contains the exact number of split strings. You can use the ArrayCount function to determine the number of strings into which the source was split.

onsecutive delimiters are treated as a single delimiter. By default, leading and trailing white space is trimmed from sub-strings.

Syntax

StrSplit(STRING sSource, STRING sDelim, INT bNoTrim)

sSource

The source string to split.

sDelim

The string to use as a delimiter. If not specified, a comma (,) is used.

bNoTrim

Optional flag to disable the trimming of white space from sub-strings. Trimming will occur by default.

Return Value

Returns a handle to the array containing all sub-strings.

Example

STRING sNames = "Phil, Michael, Bradley"

STRING sName;

INT aNames

INT iItem = 0;

aNames = StrSplit(sNames, ",");

WHILE (sName <> "") DO

sName = ArrayGetString(aNames, iItem);

iItem = iItem + 1;

END

ArrayDestroy(aNames);

StrEndsWith, StrListContainsItem, StrTruncFontTooltip

See Also

String Functions

Using the Caret Escape Sequence Character

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in