CString Splitter?
-
Currently inputting characters into a string varible in the CString class How can i cut a set of characters from the string into another varible? for example: - in the string is "Project" how can i extract just the "Pro" part out of it into a varible? Thanks for your help:)
-
Currently inputting characters into a string varible in the CString class How can i cut a set of characters from the string into another varible? for example: - in the string is "Project" how can i extract just the "Pro" part out of it into a varible? Thanks for your help:)
You can use the String splitting functions of CString Left, Right, Mid. For searching after certain characters you can use the Find methods. But you have to keep in mind that those are index based functions, so you have to either rely on fixed index positions or your string has to contain nearly the same content.
-
Currently inputting characters into a string varible in the CString class How can i cut a set of characters from the string into another varible? for example: - in the string is "Project" how can i extract just the "Pro" part out of it into a varible? Thanks for your help:)
AlexDrummer wrote:
for example: - in the string is "Project" how can i extract just the "Pro" part out of it into a varible?
CString s = CString("Project").Left(3);
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne