I need to concatenate a list of MFC CString objects into a single CSV string. .NET has String.Join for this task. Is there an established way to do this in MFC/C++?
I need to concatenate a list of MFC CString objects into a single CSV
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
+operator is overloaded to allow string concatenation. I’d suggest take a look at the documentation on MSDN:Basic CString Operations has the following example:
If you want the strings to be comma-separated, just add the commas yourself.