SplitString()

Summary

Divides a string into pieces based on the position of vertical bars (|) in that string.

Syntax

pieces = SplitString(string s)

Argument Contents
s The string that is split

Returns

An array of pieces of the string, or null if s is null.

Notes

  • SplitString can be used to parse the results of GetEditorView(), GetWindows() , and many other functions.

  • If s contains no vertical bars, then the return value is an array of one string.

  • SplitString() does not include the vertical bars in the strings that make up the returned array.

  • If s contains two consecutive vertical bars, the returned array contains a null in the corresponding position.

Example

subs = SplitString("Map|My First Map")
// returns {"Map", "My First Map"}

See Also

Function Summary
CompareStrings() Compares two strings to see if they match
JoinStrings() Returns a concatenated string separated by the delimiter
ParseString() Divides a string into pieces separated by the specified delimiters
SplitPath() Splits a path and filename into its component parts
Word() Extracts one word from a string