views:

266

answers:

1

Hi, Is there a way to remove tags from text, that was copy-pasted from Word 2007 on a server side (.NET) or client one (javascript). I need just text, without any formatting.

+2  A: 

I would suggest removing all tags on the server site, so no one with deactivated JavaScript sees them:

using System.Text.RegularExpressions;
string word2007 = "<h3>word2007</h3><p>test</p>";
Regex.Replace(word2007 ,"<[^>]*>",string.Empty)
merkuro