public void CheckForSubstring()
{
string str = "onetwothree";
bool result = str.Contains("two");
Console.WriteLine(result); //returns True
result = str.Contains("Two"); //returns False, bcoz C# is case sensitive
Console.WriteLine(result);
}
Output: True
False
No comments:
Post a Comment