CString Objects & subString :: MFC
-
-
Hi. Is there a function to get a substring of a CString object? I can use GetAt() in a loop. Nonetheless, I was wondering if there is a function specifically for accessing a substring of a CString object similar to an STL string object. Thanks, Kuphryn
Certainly! The Mid() function has two overloads. In both cases, the first parameter is the starting index of the substring. If you pass a second parameter, it is the count of characters in the substring to return. Or if only one integer is passed, the remainder of the string is returned. Scot Brennecke Software Developer VC++ MVP
-
Certainly! The Mid() function has two overloads. In both cases, the first parameter is the starting index of the substring. If you pass a second parameter, it is the count of characters in the substring to return. Or if only one integer is passed, the remainder of the string is returned. Scot Brennecke Software Developer VC++ MVP
-
Hi. Is there a function to get a substring of a CString object? I can use GetAt() in a loop. Nonetheless, I was wondering if there is a function specifically for accessing a substring of a CString object similar to an STL string object. Thanks, Kuphryn
Take a look at Mid, Left and Right Nish
Author of the romantic comedy Summer Love and Some more Cricket [New Win]