Andi03 Posted October 13, 2003 Posted October 13, 2003 Hi. How do I display all the info from my DB as plain text even if someone have entered som HTML och som other code into the post field in my forum Ex. If someone replays to a message in my forum and enter this into to the the text field: <font size='7'>Test</font> How do I make so when I get the info from the DB so it wont display test in size seven insted it should write out <font size='7'>Test</font> Do you understand what Im want to do? //Andi Quote
WebJumper Posted October 14, 2003 Posted October 14, 2003 What you are looking for are Regular Expressions (System.Text.RegularExpression) Solution for your prob: string inputString = "<big>test</big>"; Regex r = new Regex("<[^>]*>"); string HtmlCuttedString = r.Replace(inputString, ""); Regards! Quote
Moderators Robby Posted October 14, 2003 Moderators Posted October 14, 2003 WebJumper, I think what he wants is to display the tags as-is not to render them. Quote Visit...Bassic Software
WebJumper Posted October 16, 2003 Posted October 16, 2003 you think so? then type: string s = "<big>test</big>"; s = s.Replace("<", "<").Replace(">", ">"); Quote
Moderators Robby Posted October 16, 2003 Moderators Posted October 16, 2003 Yeah that would work. Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.