Click here to Skip to main content
15,908,112 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Separet two strings Pin
CPallini5-May-08 0:57
mveCPallini5-May-08 0:57 
GeneralRe: Separet two strings Pin
sharanu5-May-08 1:09
sharanu5-May-08 1:09 
AnswerRe: Separet two strings Pin
Rajesh R Subramanian5-May-08 1:11
professionalRajesh R Subramanian5-May-08 1:11 
GeneralRe: Separet two strings Pin
CPallini5-May-08 2:00
mveCPallini5-May-08 2:00 
GeneralRe: Separet two strings Pin
sharanu5-May-08 1:43
sharanu5-May-08 1:43 
GeneralRe: Separet two strings Pin
Rajesh R Subramanian5-May-08 1:55
professionalRajesh R Subramanian5-May-08 1:55 
AnswerRe: Separet two strings Pin
Rajesh R Subramanian5-May-08 1:09
professionalRajesh R Subramanian5-May-08 1:09 
AnswerRe: Separet two strings Pin
Rajesh R Subramanian5-May-08 0:00
professionalRajesh R Subramanian5-May-08 0:00 
sharanu wrote:
#Sample.jpg#TSXGMP850_EN_V10.pdf


Will the pattern of the string be same all the time? If it won't, then you may need to write a generalised approach.

Assuming that the pattern of the string will be the same, here is a way to do what you want:
CString str = _T("#Sample.jpg#TSXGMP850_EN_V10.pdf");

CString str1, str2;

int iPos = str.ReverseFind('#');
str2 = str.Mid(iPos+1);

str1 = str.Left(iPos);
str1.Remove('#');

AfxMessageBox(str1);
AfxMessageBox(str2);



Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP

AnswerRe: Separet two strings Pin
David Crow5-May-08 3:37
David Crow5-May-08 3:37 
QuestionAsynchronous Serial Port Communication Pin
phanindra varma4-May-08 21:29
phanindra varma4-May-08 21:29 
AnswerRe: Asynchronous Serial Port Communication Pin
Rajkumar R5-May-08 3:35
Rajkumar R5-May-08 3:35 
QuestionMemory Management Problem C++ (malloc & free) Pin
dehseth4-May-08 20:41
dehseth4-May-08 20:41 
AnswerRe: Memory Management Problem C++ (malloc & free) Pin
Cedric Moonen4-May-08 20:44
Cedric Moonen4-May-08 20:44 
AnswerRe: Memory Management Problem C++ (malloc & free) Pin
Rajkumar R4-May-08 21:16
Rajkumar R4-May-08 21:16 
AnswerRe: Memory Management Problem C++ (malloc & free) Pin
BadKarma4-May-08 21:25
BadKarma4-May-08 21:25 
QuestionRe: Memory Management Problem C++ (malloc & free) Pin
Rajkumar R4-May-08 21:34
Rajkumar R4-May-08 21:34 
AnswerRe: Memory Management Problem C++ (malloc & free) Pin
Rajesh R Subramanian4-May-08 22:41
professionalRajesh R Subramanian4-May-08 22:41 
AnswerRe: Memory Management Problem C++ (malloc & free) Pin
Eakalavya4-May-08 21:25
Eakalavya4-May-08 21:25 
GeneralRe: Memory Management Problem C++ (malloc & free) Pin
dehseth5-May-08 1:12
dehseth5-May-08 1:12 
AnswerRe: Memory Management Problem C++ (malloc & free) Pin
jhwurmbach4-May-08 21:36
jhwurmbach4-May-08 21:36 
AnswerRe: Memory Management Problem C++ (malloc & free) Pin
CPallini4-May-08 21:41
mveCPallini4-May-08 21:41 
GeneralRe: Memory Management Problem C++ (malloc & free) Pin
dehseth5-May-08 0:45
dehseth5-May-08 0:45 
QuestionRe: Memory Management Problem C++ (malloc & free) Pin
David Crow5-May-08 3:34
David Crow5-May-08 3:34 
AnswerRe: Memory Management Problem C++ (malloc & free) Pin
dehseth5-May-08 6:05
dehseth5-May-08 6:05 
GeneralRe: Memory Management Problem C++ (malloc & free) Pin
David Crow5-May-08 6:17
David Crow5-May-08 6:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.