Returns 1D or 2D array of strings splitted by given row and column delimiters
#include "String and File String.au3" _StringToArray( $sString [, $sDelimiter = " " [,$sRowDelimiter = Default] [, $cConvert = ""]]] ) |
$sString | String to split |
$sDelimiter | Delimiter, default space |
$sRowDelimiter | Row delimiter for splitting to 2D array |
$cConvert | Convert column according to format: c = string, b = boolean, n = number, d = binary |
array value | Array of splitted strings, @extended = number of rows in array |
$aArray = _StringToArray("1,Hello world,01/01/2020,True" & @CRLF
& "2,Hello universe,02/01/2020,False", ",", @CRLF, "NCCB")
; $aArray has 2 rows with 4 columns of types: int32, string, string (date)
and boolean
$aArray = _StringToArray("1,Hello world,01/01/2020,True" & @CRLF
& "2,Hello universe,02/01/2020,False", ",", @CRLF)
; $aArray has 2 rows with 4 string columns
$aArray = _StringToArray("1,Hello world,01/01/2020,True", ",", Default,
"NCCB")
; $aArray has 4 elements of types: int32, string, string
(date) and boolean
$aWords = _StringToArray("Hello world") ; $aWords containss 2 words