Imports System
Public Class EndsWithTest
Public Shared Sub Main()
Dim strSource As String() = { "This is bold text","wrong>"}
Dim s As String
For Each s In strSource
Console.WriteLine(StripEndTags(s))
Next s
End Sub
Private Shared Function StripEndTags(item As String) As String
If item.Trim().EndsWith(">") Then
Dim lastLocation As Integer = item.LastIndexOf("")
If lastLocation >= 0 Then
item = item.Substring(0, lastLocation)
End If
End If
Return Item
End Function
End Class