|
Converts a string into an array using the separator string as a delimiter.
syntax
CStrToArray(
str
[, separator = LF]
[, bTrimSpace = FALSE]
[, bIgnoreEmptyData = FALSE]
)
Parameters
str
|
|
Type:
|
General purpose
|
|
The source character.
|
separator
|
|
Type:
|
General purpose
|
|
Separator string, default is line field (LF).
|
bTrimSpace
|
|
Type:
|
Boolean
|
|
When TRUE, any space characters on either end of the characters decomposed into each column will be deleted.
|
bIgnoreEmptyData
|
|
Type:
|
Boolean
|
|
When TRUE is set, if the characters separated into each column are empty, they will not be added as a record.
|
Return Value
|
|
Type:
|
character
|
|
The converted array.
|
Explanation
This converts a string to an array using a separator string as a delimiter. For example, after reading a text file, you can use this to break it down into an array for each line. All elements of the array will be strings.
The number of elements in an array can be obtained using ::GetValueTotalElement.
|
Example
|
var vText;
::LoadTextFile("xxx.txt", vText);
var vTextArray = ::CStrToArray(vText);
var vLines = ::GetValueTotalElement(vTextArray);
|
|
Supported
reference
StrLen
MBStrLen
LeftStr
RightStr
MidStr
FindStr
IsLike
InsertStr
RepeatInsertStr
CombineStr
DivideStr
TrimLeftStr
TrimRightStr
UpperStr
LowerStr
ReplaceStr
ReverseStr
CStrToArray
CArrayToStr
CCsvToArray
CArrayToCsv
Chr
Ascii
RET
IntStrs
IsFullWidthChar
MeasureStr
|