Quote Originally Posted by Lvalera View Post
Finally I have used the solution you mention and it worked... the string I am working is a path string, something as: C:\Users\Public\Documents\some_folder\text.txt
so what I need the part "some_folder" extracted and been a CString
I have worked out how detect "\" before "some_folder" part, so what I needed was to copy everything before the next "\"...
All worked, I mean I was able to detect where to start copping and where to stop....
the actual copping the part of the CString one to CString two didn't work...
But with the help from this site I was able to do it in two methods:
1) using SetAt() function
2) char x=one[n];
two+=x;

both methods work, I kept the second one...
so, at the start I had two problems:
1) two[y]=one[x] // never works
2) CString two; // is empty string and it should not be empty

thanks for the help
regards
Val
Why not use CString::Mid to extract the portion you want?