Killsoft Sugdok


Join the forum, it's quick and easy

Killsoft Sugdok
Killsoft Sugdok
Would you like to react to this message? Create an account in a few clicks or log in to continue.

VB.NET Remove HTML

Go down

VB.NET Remove HTML Empty VB.NET Remove HTML

Post by giovhz 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.
giovhz
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