AfxStrJoinfunction
Returns a string consisting of all of the strings in an array, each separated by a delimiter.
Syntax
FUNCTION AfxStrJoin (BYREF dsa AS DSAFEARRAY, BYREF wszDelimiter AS WSTRING = " ") AS DWSTRING
Parameters
| Name | Description | |
|---|---|---|
dsa | The one-dimensional VT_BSTR DSAFEARRAY to join. | |
wszDelimiter | The delimiter character. |
Return value
A DWSTRING containing the joined string.
Description
Returns a string consisting of all of the strings in an array, each separated by a delimiter. If the delimiter is a null (zero-length) string then no separators are inserted between the string sections. If the delimiter expression is the 3-byte value of "," which may be expressed in your source code as the string literal """,""" or as Chr(34,44,34) then a leading and trailing double-quote is added to each string section. This ensures that the returned string contains standard comma-delimited quoted fields that can be easily parsed.
Example
DIM dsa AS DSAFEARRAY = DSAFEARRAY("STRING", 3, 1) dsa.PutStr(1, "One") dsa.PutStr(2, "Two") dsa.PutStr(3, "Three") DIM dws AS DWSTRING = AfxStrJoin(dsa, ",") PRINT dws ' ouput: One,Two,Three
Reference
- Include file
DSafeArray.inc - Defined in AfxNova/DSafeArray.inc:2222
- Documented in COM/DSAFEARRAY Class.md
- Topic: DSAFEARRAY Class