Click here to Skip to main content
15,917,645 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Library Usage Problem Pin
MicroVirus16-Sep-11 4:40
MicroVirus16-Sep-11 4:40 
GeneralRe: Library Usage Problem Pin
Erudite_Eric16-Sep-11 4:49
Erudite_Eric16-Sep-11 4:49 
GeneralRe: Library Usage Problem Pin
MicroVirus16-Sep-11 12:16
MicroVirus16-Sep-11 12:16 
AnswerRe: Library Usage Problem Pin
Richard MacCutchan14-Sep-11 23:36
mveRichard MacCutchan14-Sep-11 23:36 
GeneralRe: Library Usage Problem Pin
Albert Holguin16-Sep-11 4:03
professionalAlbert Holguin16-Sep-11 4:03 
GeneralRe: Library Usage Problem Pin
Richard MacCutchan16-Sep-11 5:24
mveRichard MacCutchan16-Sep-11 5:24 
GeneralRe: Library Usage Problem Pin
Albert Holguin16-Sep-11 5:58
professionalAlbert Holguin16-Sep-11 5:58 
AnswerRe: Library Usage Problem Pin
Chris Meech15-Sep-11 8:18
Chris Meech15-Sep-11 8:18 
QuestionDesign of Application Pin
002comp14-Sep-11 23:04
002comp14-Sep-11 23:04 
AnswerRe: Design of Application Pin
Richard MacCutchan15-Sep-11 0:15
mveRichard MacCutchan15-Sep-11 0:15 
GeneralRe: Design of Application Pin
002comp15-Sep-11 0:27
002comp15-Sep-11 0:27 
GeneralRe: Design of Application Pin
Richard MacCutchan15-Sep-11 0:35
mveRichard MacCutchan15-Sep-11 0:35 
QuestionCRichCtrl Pin
john563214-Sep-11 22:02
john563214-Sep-11 22:02 
AnswerRe: CRichCtrl Pin
Richard MacCutchan14-Sep-11 22:21
mveRichard MacCutchan14-Sep-11 22:21 
GeneralRe: CRichCtrl Pin
john563214-Sep-11 22:45
john563214-Sep-11 22:45 
GeneralRe: CRichCtrl Pin
Richard MacCutchan14-Sep-11 23:25
mveRichard MacCutchan14-Sep-11 23:25 
QuestionRe: CRichCtrl Pin
David Crow15-Sep-11 2:42
David Crow15-Sep-11 2:42 
QuestionExecuting two project side by side Pin
Coder Block14-Sep-11 19:06
Coder Block14-Sep-11 19:06 
AnswerRe: Executing two project side by side Pin
Chandrasekharan P14-Sep-11 19:40
Chandrasekharan P14-Sep-11 19:40 
GeneralRe: Executing two project side by side Pin
Coder Block14-Sep-11 20:41
Coder Block14-Sep-11 20:41 
GeneralRe: Executing two project side by side Pin
Richard MacCutchan14-Sep-11 21:36
mveRichard MacCutchan14-Sep-11 21:36 
QuestionRe: Executing two project side by side Pin
David Crow15-Sep-11 2:44
David Crow15-Sep-11 2:44 
AnswerRe: Executing two project side by side Pin
Albert Holguin16-Sep-11 4:07
professionalAlbert Holguin16-Sep-11 4:07 
QuestionSimple C to C++ [modified] Pin
Software200714-Sep-11 8:20
Software200714-Sep-11 8:20 
AnswerRe: Simple C to C++ Pin
User 742933814-Sep-11 8:46
professionalUser 742933814-Sep-11 8:46 
You could do it like this:

string replace_html_delimiters(string msg)
{
	for(int i=0;msg[i];i++)
		if(msg[i] == '<')
			msg.replace(i,1,"<",0,4);   // "& l t ;", CodeProject won't display this properly but I'm guessing this is what you want.

	return msg;
}


The msg[i] == NUL has been moved to the for-loop and the replace[^] function is used for replacing '<'-characters with & l t ;.

Note that unlike with a char array, a string will not be modified when passed to a function like this. I solved this by returning the output string, but you could also convert your function to accept a string pointer as argument.

modified 13-Sep-18 21:01pm.

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.