Click here to Skip to main content
16,007,687 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Separet two strings Pin
Rajkumar R4-May-08 23:53
Rajkumar R4-May-08 23:53 
GeneralRe: Separet two strings Pin
ThatsAlok5-May-08 2:34
ThatsAlok5-May-08 2:34 
GeneralRe: Separet two strings Pin
Rajkumar R5-May-08 3:04
Rajkumar R5-May-08 3:04 
GeneralRe: Separet two strings Pin
ThatsAlok5-May-08 3:46
ThatsAlok5-May-08 3:46 
GeneralRe: Separet two strings Pin
Rajkumar R5-May-08 3:59
Rajkumar R5-May-08 3:59 
GeneralRe: Separet two strings Pin
CPallini5-May-08 0:16
mveCPallini5-May-08 0:16 
GeneralRe: Separet two strings Pin
ThatsAlok5-May-08 3:20
ThatsAlok5-May-08 3:20 
GeneralRe: Separet two strings Pin
CPallini4-May-08 23:52
mveCPallini4-May-08 23:52 
For instance you can do:
CString s = "#Sample.jpg#TSXGMP850_EN_V10.pdf";
CString szAttachment[10];
int iAttachment = 0;
int iStart; // skip first #
int iEnd;

for ( iStart = 1, iEnd = 0; iEnd != -1; )
{
  iEnd = s.Find("#", iStart);
  if ( iEnd != -1 )
  {
    szAttachment[iAttachment] = s.Mid(iStart, iEnd-iStart);
    iStart = iEnd + 1;
  }
  else
  {
    szAttachment[iAttachment] = s.Mid(iStart);
  }
}


Please note that above code is (intentionally, for concision purposes) not robust.
Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke


GeneralRe: Separet two strings Pin
Rajesh R Subramanian5-May-08 0:02
professionalRajesh R Subramanian5-May-08 0:02 
GeneralRe: Separet two strings Pin
CPallini5-May-08 0:18
mveCPallini5-May-08 0:18 
GeneralRe: Separet two strings Pin
Rajesh R Subramanian5-May-08 0:38
professionalRajesh R Subramanian5-May-08 0:38 
JokeRe: Separet two strings Pin
CPallini5-May-08 1:03
mveCPallini5-May-08 1:03 
GeneralRe: Separet two strings Pin
Rajesh R Subramanian5-May-08 1:13
professionalRajesh R Subramanian5-May-08 1:13 
GeneralRe: Separet two strings Pin
sharanu5-May-08 0:27
sharanu5-May-08 0:27 
GeneralRe: Separet two strings Pin
CPallini5-May-08 0:35
mveCPallini5-May-08 0:35 
GeneralRe: Separet two strings Pin
sharanu5-May-08 0:40
sharanu5-May-08 0:40 
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 
AnswerRe: Separet two strings Pin
David Crow5-May-08 3:37
David Crow5-May-08 3:37 

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.