Imports System
Imports Microsoft.VisualBasic
Public Module Module1
Public Sub Main()
Dim Name As String = "Israel"
Dim ExcludedWords As String() = {"test1", "israel", "def", "ghi"}
For Each word In ExcludedWords
Name = Replace("", word, "", , , CompareMethod.Text)
If Name.Trim = "" Then
' We cannot reduce `Name` any more than that, no reason to keep looping over the stopwords
Exit For
End If
Next
Console.WriteLine(Name.Trim)
End Sub
End Module