string body = Selenium.GetBodyText();
if (body.Contains("software", StringComparison.CurrentCultureIgnoreCase))
{
//do something
}
I get a string does not contain a definition for Contains
message when I do the above. What am I doing wrong here? Thanks in advance everyone!
I am trying to check if body has the string "software", "Software" or "SOFTWARE". body will contain paragraphs and paragraphs of text (string).
I don't believe string
has an overload of Contains
taking a StringComparison
. However, you could use IndexOf
which does:
if (body.IndexOf("software", StringComparison.CurrentCultureIgnoreCase) != -1)
String.Contains only take one parameter - your code should be
bodyText.Contains("software");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With