Unable to compare 2 strings using If condition

Hi,

I’m trying to automate one excel process. Here I’m trying to match the data

  1. (“if var1.equals(var2)”)…or
  2. (“if var1.contains(var2)”)…continue the process…if the 2 variables are not matching…then go to else condition. But the data what I’m passing to 2 variables are same…So is variables length. But still Bot is going to Else condition even 2 variables data is same instead of going to the next step. I’m still unable to compare 2 strings using If activity.

Have tried trimming the data, removed spaces, tried passing the data through char array. But still Bot is going to else condition. Never experienced this kind of error…Any suggestions on this please?

Thanks.

HI,
Used Var1.tostring=Var2.tostring.

try to add trim and to lower/to upper and .tostring, if possible, please share the variable values here

Hi,

Thank you…Used Regex and removed all the special characters and used If condition. It’s working now…:slight_smile:

1 Like