Killsoft Sugdok

VB.NET Remove HTML

Go down

VB.NET Remove HTML

Post by giovhz on Sun Mar 24, 2013 1:50 am

Imports System.Text.RegularExpressions

Module Module1

Sub Main()
' Input.
Dim html As String = "<p>There was a <b>.NET</b> programmer " +
"and he stripped the <i>HTML</i> tags.</p>"

' Call Function.
Dim tagless As String = StripTags(html)

' Write.
Console.WriteLine(tagless)
End Sub

''' <summary>
''' Strip HTML tags.
''' </summary>
Function StripTags(ByVal html As String) As String
' Remove HTML tags.
Return Regex.Replace(html, "<.*?>", "")
End Function

End Module

Output

There was a .NET programmer and he stripped the HTML tags.
avatar
giovhz
Newbie
Newbie

Posts : 41
Join date : 2013-03-09

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum