Click to add

Click to add
ex: [email protected]

Click to add
What would you like to tell me?

 

  • Home
  • Blog
  • Portfolio
  • Articles
  • Downloads
  • Contact

This is how I blog...

  • Home/
  • Blog/
  • Leverage RadEditor to Strip HTML

Leverage RadEditor to Strip HTML

The RadEditor does a pretty badass job of stripping HTML since you can feed the html string into the .Content property, and then just read it back out via the Text property.  Here's a quick extension method which does just that

public static string StripHtml(this string @htmlText) {
RadEditor editor = new RadEditor();
editor.Content = htmlText;
return editor.Text;
}

 Ok so now this makes the StripHtml method available right on the object instead of needing to pass in a value and return something back.  Just like .ToString(), you'll now do .StripHtml()

string pureText = myHtmlString.StripHtml();
 
//or
 
return myHtmlString.StripHtml();
RadEditor can strip your HTML for you, here's how
tutorial
html , radeditor
  • LinkedIn
Back to all posts
March 15, 2012   /  
Visit Steve on Google+
comments powered by Disqus

Search

Blog Categories

  • fixes
  • news
  • other
  • previews
  • rants
  • reviews
  • tutorial

Recent Comments

Tags

3x404243444x5253AjaxAnalyticsAsp.netBetablog-postboolChoiceFieldCommunityContentViewContextContractControlscssCTPCufonDatabaseDelaysDesignDetailDisqusdowntimeDropboxdynamicDynamicContenteCommerceELMAHEnergy-MarketersEntendingErrorEventsExtensionFieldControlFixFlatTaxonFieldFontsFormsGeneric-ContentGoogleHierarchicalTaxonFieldhostingHtmlimageImagesjavascriptJobjQueryJustJustCodeJustDecompileJustTraceKendoUILayoutControlsLogMarketersMasterMindscapeMinificationModule-Buildernew-productsNotesOpenAccessOptomizationPage-EditPerformancePITSportfolioPreviewPrimerRackspaceRadChartRadControlsRadEditorRadNotificationRadStyleSheetManagerRadXmlHttpPanelreleaseReportingResolutionReviewroadmapRoutingScamScrewedSDKSearchSelectorsServicessitefinitySkinsSpeedSQLStored-ProcedureStored-ProceduresteleriktellarickTemplatesthemeToolsUpdateuptimeVersionsViewstateWCFwebinarWebservicesWF4XmlHttpPanelYSOD
FreshBooks

Latest Blog Posts

  • The Sitefinity ContentView can be an ass#$%@ sometimes
    The problem with the assumtions Sitefinity ContentView makes
  • Fixing Ugly Hierarchical DynamicContent Urls
    Sitefinitys default Hierarchical DynamicContent control has no Url flexability...here's how we can fix all that so we have nicer routing.

Recent Twitter

Recent Comments

Address

Hamilton, ON
Canada
Site: http://www.sitefinitysteve.com
Email: contact
Buy me a beer

Disclaimer

Important: This site is perhaps too awesome for some users.  Please self govern your own awesomeness before browsing the awesome content.  
Telerik MVP Logo

Back to Top