Topic: Auto it to deduce substrings from a line.
$elem_1 = StringSplit ("1 2 3 4", "", 1) MsgBox (4096, "we Return an amount of elements:", $elem_1 )
I Want, that the amount of elements four was deduced, and deduces six.
Here help, like on it would do.
Divides a line into substrings, depending on the given separator.
StringSplit ("string", "delimiters" [flag = 0])
string the Used line.
delimiters One or more characters are used as a separator (match case).
flag [optional] Change of a method of sharing, can be a combination of following values:
0 - (by default), each character in a separator of a line is a separator.
1 - all line of a separator is a separator.
2 - to disconnect resetting of an amount of elements in the first array cell (it is necessary to use UBound () to receive the size of an array).
Returns an array in which by default the first element $aArray  contains an amount of the returned lines, remaining elements ($aArray , $aArray , etc.) contain the partitioned lines. If flag = 2 in the first element the amount of elements is not returned, and the first element of the partitioned line is returned.
If the separator in a required line is not found, @error = 1, the amount in $aArray [0 =1 and is returned all line in $aArray .
If you use blank line as a separator "" each character will be returned in an array cell.
If you want to use substring as a separator instead of as single characters, look an example more low.
StringSplit () it is very useful as alternative StringInStr () and as means of filling of an array.
The warning if you in a separator use - @CRLF 2 line characters which generate additional empty elements in an array are actually used.
StringRegExp, StringToASCIIArray, StringMid, StringInStr
$aDays = StringSplit ("Vs, Pn, W, Sr, Cht, Pt, a Sat" ",")
; $aDays  contains "Vs"... $aDays  contains "Sat"
_ArrayDisplay ($aDays, ' Days of week '); function for review of arrays
$sText = "Eta\nStroka\nSoderzhit\nPerenos \n style of Si."
$aArray = StringSplit ($sText, '\n ', 1)
_ArrayDisplay ($aArray, ' Analysis of a line ')
For $i = 1 To $aArray ; the Cycle shows all values element-wise.
MsgBox (4096, "the Example 2", "$aArray [" and $i and "] =" and $aArray [$i])
Only through StringRegExpReplace at first to process?