Question : vb.net - if string

hello there,
I have a string that has some data and I would like to make two buttons..

button1 that checks if string contains "name1"

button2 to check if string doesn't contain"word2"

Answer : vb.net - if string

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

 

Random Solutions  
 
programming4us programming4us