CODE ARCHIVE

Years of coding.

Articoli tecnici, tutorial di programmazione, frammenti di codice e file sorgente condivisi nel corso degli anni.

Torna a tutti gli articoli

ARTICLES

How to extract text content from tags in VB.Net

With this simple vb.net function You are able to extract content from HTML tags, useful and smart Max :)

Public Function GetTagContent(ByRef html As String, ByVal start_tag As String, ByVal end_tag As String) As String
Dim s As String = ""
 Dim content() As String = html.Split(start_tag)
 If content.Count > 1 Then
 Dim parts() As String = content(1).Split(end_tag)
 If parts.Count > 1 Then
 s = parts(0)
 End If
 End If
 Return s
End Function