###Function###
StringSplit

###Description###
Splits up a string into substrings depending on the given delimiters.

###Syntax###
StringSplit ( "string", "delimiters" [, flag = 0] )


###Parameters###
@@ParamTable@@
string
	The string to evaluate.
delimiters
	One or more characters to use as delimiters (case sensitive).
flag
	[optional] Changes how the string split works, add multiple flag values together if required:
		$STR_CHRSPLIT (0) = each character in the delimiter string will mark where to split the string (default)
		$STR_ENTIRESPLIT (1) = entire delimiter string is needed to mark the split
		$STR_NOCOUNT (2) = disable the return count in the first element - effectively makes the array 0-based (must use <a href="UBound.htm">UBound()</a> to get the size of the array in 	this case).
	Constants are defined in StringConstants.au3
@@End@@

###ReturnValue###
Returns an array, by default the first element ($aArray[0]) contains the number of strings returned, the remaining elements ($aArray[1], $aArray[2], etc.) contain the delimited strings. If the flag parameter is set to $STR_NOCOUNT (2) then the count is not returned in the first element.

If no delimiters were found then the @error flag is set to 1, count is equal to 1 ($aArray[0]) and the full string is returned ($aArray[1]).


###Remarks###
If you use an empty string "" for the delimiters, each character will be returned as an element.

If the delimiter string contains several characters function behaviour depends on the flag setting.  If set to $STR_CHRSPLIT the string will be split at every instance of each of the individual characters in the delimiter - if set to $STR_ENTIRESPLIT then the string will only be split when the entire delimiter string is encountered.  See second example below.

Note that the macro @CRLF is actually a 2 character string, so unless the flag parameter to $STR_ENTIRESPLIT extra blank lines will be generated as the string is split on both @CR and @LF.

<a href="StringSplit.htm">StringSplit()</a> is very useful as an alternative to <a href="StringInStr.htm">StringInStr()</a> as well as a means to populate an array.


###Related###
StringInStr, StringLeft, StringLen, StringLower, StringMid, StringRight, StringTrimLeft, StringTrimRight, StringUpper


###Example###
@@IncludeExample@@
