looking for a function that will htmlencode a cstring
campkev
0
Posting Pro in Training
Recommended Answers
Jump to PostWhat do you mean by that? Simply put <p> tags around a string? If that's what you want, you can write your own very simply:
string htmlcode = "<p>"+paragraph+"</p>";
Likewise, searching and replacing newlines with <br/> is also very easy. Look up some of the string functions …
Jump to PostTo HTML encode a string is to convert the " to " and < to < and > to > and & to & and you get the idea :) Essentially it's just a simple find and replace of those few things.
Jump to Post...was just looking for a function that was already written and handled all of them rather than doing them each individually....
Nope, sorry. You have to be efficient on your own... ;)
All 10 Replies
John A
1,896
Vampirical Lurker
Team Colleague
Dani
3,971
The Queen of DaniWeb
Administrator
Featured Poster
Premium Member
campkev
0
Posting Pro in Training
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
campkev
0
Posting Pro in Training
Ravalon
62
Posting Whiz in Training
campkev
0
Posting Pro in Training
King.Kong
0
Newbie Poster
King.Kong
0
Newbie Poster
jwenting
1,889
duckman
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.