Imports System
Public Class Program
Public Shared Function removeWord(ByVal str As String, ByVal word As String) As String
If str.Contains(word) Then
Dim tmp As String = word & " "
str = str.Replace(tmp, "")
tmp = " " & word
str = str.Replace(tmp, "")
End If
Return str
End Function
Public Shared Sub Main()
Dim str As String = "vb.net c# java c c++ python rust go"
Dim word As String = "rust"
str = removeWord(str, word)
Console.Write(str)
End Sub
End Class
' run:
'
' vb.net c# java c c++ python go
'