I m am trying to do a web search, the page is returning more results and i want to click one of them, for example I m searching for john(this is my variable), the page is returning me John or JOHN and right now the activity is crashing because there is no match between the result and my variable only because it is case sensitive. How can I do a simple ignore case sensitive in this activity?
If MyString is the string you’ve pulled containing “John”, “JOHN”, “john”, “JoHn”, etc., your if statement should have the condition MyString.ToLower = "john". This will make the match case insensitive.
I would need to know what is being returned to know how to help with this one. The only reason I can think of for this not to match is if the selector is pulling data that doesn’t match “john” in any form. Are you only looking for the string to contain the word “john” rather than match it? If so, you can use MyString.ToLower.Contains("john").
I may be understanding this incorrectly so please correct me where necessary.
If the page is returning John or JOHN, the case of the variable as well as the case of the page need to match. Is there a way that the results may be written to a data table so that manipulation may occur on what is being displayed on the page?
It is easier to force the variable and the result to be lower case than to try match the one to the other (in any form that it may occur).