1

I got a CString str

I want to copy str[3]~ str[5] to a brand new one. I tried C++ char* 's method, not compatible.

So what is the right way do this in VC++

Thank you,

Anders Lind
  • 4,542
  • 8
  • 46
  • 59
  • 1
    [This question](http://stackoverflow.com/questions/1014550/mfc-copy-certain-sections-of-a-cstring) might help you ... – Eitan T May 22 '12 at 23:08

1 Answers1

3

Have you tried using the the MID function?

str.Mid( 3, 3 ) should give you the substring you are looking for.

Updated reference: http://msdn.microsoft.com/en-us/library/b4c90k3d(v=vs.80).aspx

Babak Naffas
  • 12,395
  • 3
  • 34
  • 49