What do you mean by that? Simply put 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
is also very easy. Look up some of the string functions like string::find() and string::replace(): http://www.bgsu.edu/departments/compsci/docs/string.html
[edit]Or did you mean something like this ... ;)[/edit]
Hope this helps
John A
Vampirical Lurker
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
To 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.
cscgal
The Queen of DaniWeb
19,424 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 230
...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... ;)
WaltP
Posting Sage w/ dash of thyme
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
To 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.
hmm, except if the string represents PCDATA in which case it should be surrounded by tags.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337