How to ignore case to check string match

Hi All
I have a query where I need to check whether strings are same but ignore the case

Any specific function as such

Hi @Prakash_P3

Convert both string either upper or lower for comparison
STR1.ToUpper=STR2.ToUpper

2 Likes

Hey

just convert your string before you make validations, it means pass your entire string to upper or lower case

yourStringVar.ToLower.Trim.Contains("yourvalidationinlowercase")

Or

yourStringVar.ToUpper.Trim.Contains("YOURVALIDATIONINLOWERCASE")

Regards!

1 Like

Hi @Prakash_P3

You can try with @nikhil.girish or @fernando_zuluaga suggestions

Alternative way will be

System.Text.RegularExpressions.Regex.IsMatch(string1,String2,System.Text.RegularExpressions.Regexoptions.IgnoreCase)

Regards
Sudharsan

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.