How to find that substring is exist within string or not in

Contains method of the string class determine that the substring is present inthe string or not, or we can say contains method checks whether specified parameter string exist inthe string or not. this method returns boolean type value true and false.

Public function Contains(byval Value as string) as boolean

value: The System.String object to seek.

Return Values:
true if the value parameter occurs within this string, or if value is the empty string (“”); otherwise, false.


  Dim str As String = "Welcome to my home" 
  Dim isExist As Boolean = str.Contains("come") 
  If isExist Then 
     MessageBox.Show("not found") 
  End If

Author: Hirendra Sisodiya

Programmer at PSPL. Can be found on Google Plus.