set
This function converts a value provided to a set.
In case of converting strings: The input string may be embedded in braces ("{ … }" ) or not. The elements must be separated with commas. The number of opening and closing braces must be equal. Braces inside quotation marks are considered as part of a text element to include.
Any additional or missing characters (incl. spaces) will suppress automatic date conversion. If you have other date formats (e.g. MM/DD/YY, hh:mm), convert them by dates afterwards with the date(…) function.
Reason: Strings in conversion from sets to string will be put into single quotation marks and internal single quotation marks needed to be encoded to avoid confusion with closing quotation marks
Note: This particular function does not support vectorization.
Indirect parameter passing is disabled
1
No. | Type | Description |
---|---|---|
1 input |
valid types | Value Value to be converted as described above. |
Type | Description |
---|---|
set | Result Identified set |
echo( set ( "{a,1,{true,TRUE,false}} " ) ); // {{'a',1,{true,'TRUE',false}}}
echo( set ( "a,1,{true,TRUE,false} " ) ); // {'a',1,{true,'TRUE',false}}
echo( set ( "2019-07-14,10:30:00" ) ); // 2 date values: { 2019-07-14,10:30:00 }
echo( type( set ( "2019-07-14,10:30:00" ){0} ) ); // Check type of date
echo( set ( "2019/07/14,10:30" ) ); // 2 strings: { '2019/07/14','10:30' } (not qualified as dates)
echo( set ( "{a,,b}" ) ); // 4 strings: { 'a','','','b' } (2 strings are blank)
{{'a',1,{true,'TRUE',false}}}
{'a',1,{true,'TRUE',false}}
{'2019-07-14','10:30:00'}
date
{'2019/07/14','10:30'}
{'a','','b'}