I have a string that comes in. When it comes it I dont care how big.
After that I need to make the string only 10 characters long
How do I force a CString to ditch all the letters after the 10th one.
Printable View
I have a string that comes in. When it comes it I dont care how big.
After that I need to make the string only 10 characters long
How do I force a CString to ditch all the letters after the 10th one.
Try this :
CString szText = "abcdefghijklmn...";
if(szText.GetLength() > 10)
szText = szText.Left(10);