in the click event for the button1..
if not String.IsNullOrEmpty(MyString) then
if MyString.Contains("name1") then
'some code..
end if
End if
in the click event for the button2..
if not String.IsNullOrEmpty(MyString) then
if not MyString.Contains("word2") then
'some code..
end if
End if