How do we user - CaseInsensitiveComparer in UiPath

Hello Masters,

Please give an example for using CaseInsensitiveComparer in UiPath

I don’t think it’s going to be a useful class to use. Even microsoft’s own documentation states
" Important

We don’t recommend that you use the CaseInsensitiveComparer class for new development. Instead, we recommend that you use the System.StringComparer object returned by the StringComparer.CurrentCultureIgnoreCase, StringComparer.InvariantCultureIgnoreCase, or StringComparer.OrdinalIgnoreCase property."

What is your use case? If it is a string, just use string.equals(str1,str2,stringcomparison.OrdinalIgnoreCase)

1 Like

Thanks Dave

I am trying to compare 2 excel columns…
for example
column1 - aab,Cab,dot
column2 - AaB,CAb.DoT

If strVar1 and strVar2 are your string variables and isCaseInsensativeEqual, use code below:

isCaseInsensativeEqual = (strVar1.trim.ToLower = strVar2.trim.ToLower)