List Split / Join



[1]
strX.join( list, { {,propDlm} , valDlm} ) Join List values to String
  Returns strS / strD / <err>
  propDlm String propDelimiter.
  valDlm String valDelimiter. Default value: <return> (13)
     
  Description Joins a List or PropList to a string
if list is a propList, and both propDlm and valDlm are passed, both properties and values will be included in the final string.
Otherwise, even if list is a propList, only its values will be included in the final string.
The type and the codepage of the return string depend on strX's. E.g., if strX is DDS, the result will be a DDS.
     
  Examples put _s().join([#a, #b]) --default value (return) will be used as delimiter
-- #a
#b
put _s().join([#a, #b], "*") --"*" will be used as delimiter
-- #a*#b
put _s().join([#a:1, #b:2])  --props will be ignored, return will be used as delimiter
-- 1
2
put _s().join([#a:1, #b:2], "*") --props will be ignored, "*" will be used as delimiter
-- 1*2
put _s().join([#a:1, #b:2], ":", return) --":" will be used for props, return for the pair
-- #a:1
#b:2

A delimiter can contain more than one characters:
put _s().join([#a, #b], "* a lengthy delimiter *")
-- #a* a lengthy delimiter *#b
     
  Notes If dlm is followed by an integer value, the two values are treated as a string/CP pair.

[2]
strX.joinProps( proplist, dlm ) Join List values to String
  Returns strS / strD / <err>
  dlm String delimiter. Default value: <return> (13)
     
  Description Joins the properties of a PropList to a string
The type and the codepage of the return string depend on strX's. E.g., if strX is DDS, the result will be a DDS.
     
  Examples put _s().joinProps([#a:#aa, #b:#bb]) --default value (return) will be used as delimiter
-- #a
#b
put _s().joinProps([#a:#aa, #b:#bb], ",") --"," will be used as delimiter
-- #a,#b
     
  Notes If dlm is followed by an integer value, the two values are treated as a string/CP pair.

[3]
strX.split( {propDlm,} valDlm )  / splitDir(  {propDlm,} valDlm ) split string to List or PropList
  Returns list / propList / <err>
  propDlm String propDelimiter.
  dlm String delimiter. Default value: <return> (13)
     
  Description Splits a string to a list or propList.
If both propDlm and valDlm are used, a propList will be returned.
If neither is used, <return> will be used as valDlm.
The string list entire's type and CP depend on strX's type and CP.
 
     
  Examples jStr = _s().join([#a:"A", #b:"B"], "*", "<>")
put jStr
-- #a*A<>#b*B
put jStr.split()
-- [#a*A<>#b*B]
put jStr.split("*")
-- [#a, A<>#b, B]
put jStr.split("*", "<>")--this command will reconstruct the original list.
-- [#a: A, #b: B]        --note that the result list's properties are strings, not symbols.

put jStr.splitDir("*", "<>")  --split to director strings.
-- ["#a": "A", "#b": "B"]
     
  Notes If dlm is followed by an integer value, the two values are treated as a string/CP pair.