What is the preferred/easiest way to manipulate TDesC strings, for example to obtain a substring.
I will give you an example of my scenario.
RBuf16 buf; ... CEikLabel label; ... label->SetTextL(buf); // (SetTextL takes a const TDesC&)
I want to get a substring from buf. So do I want to manipulate the RBuf16 directly and if so what is the best way?
Is there a way to convert to const char* so I can just use standard C string manipulation.
Thanks in advance
Read descriptors.blogspot.com (scroll down once loaded).
You can use TDes::LeftTPtr, TDes::RightTPtr or TDes::MidTPtr which will give you a substring as a TPtr (i.e. a descriptor which manipulates the original data).
You can use the TDes::Copy function if you want to create a copy of your substring.