How i remove a part of a string
-
CString Test = "Remove the word TEST" how i remove the TEST ? so i gonna have CString Test = "Remove the word "
-
CString Test = "Remove the word TEST" how i remove the TEST ? so i gonna have CString Test = "Remove the word "
-
CString sData="Remove the word TEST"; CString sWord="TEST"; int nIndex=sData.Find(sWord,0); if (nIndex!=(-1)) { // Found it sData.Delete(nIndex,sWord.GetLength()); } TRACE("%s",sData);
thank you very much bob16972 you helped me much today :D
-
CString Test = "Remove the word TEST" how i remove the TEST ? so i gonna have CString Test = "Remove the word "
-
That'll remove every instance of the word "TEST". The other will remove the first instance only. Just a heads up for the sake of clarity. For what it's worth...
-
Honestly I'm not sure at this point. You were right in posting your stuff. I wasn't jumping on it. I just threw in the clarification for they're benefit so they knew the implications of each method. Sorry if I approached that wrong. It never dawned on me that the user might want all instances removed so I'm glad you caught that. Thanks and take care.
-
That'll remove every instance of the word "TEST". The other will remove the first instance only. Just a heads up for the sake of clarity. For what it's worth...
bob16972 wrote:
That'll remove every instance of the word "TEST". The other will remove the first instance only
In that case how will he/she determine which TEST keyword he have to removed
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You