Problem in Reading string

  • Thread starter Thread starter Amrro
  • Start date Start date
A

Amrro

Hi

I am using VC++.NET, I have a string

c:\folder1;c:\folder2;c:\folder3

I want to sepreate this string into a array of string which should contain

c:\folder1
c:\folder2
c:\folder3

Please Help me.

Amrro
 
CString src = "c:\\folder1;c:\\folder2;c:\\folder3";
int i = 0;
CString token = src.Tokenize(";",i);
while(token != "")
{
cout << (LPCTSTR)token << endl;
token = src.Tokenize(";",i);
}
 
Amrro said:
Hi

I am using VC++.NET, I have a string

c:\folder1;c:\folder2;c:\folder3

I want to sepreate this string into a array of string which should contain

c:\folder1
c:\folder2
c:\folder3

Please Help me.


What about copying it character by character until you encounter ';'?
 
Back
Top