Comparing strings but getting unexpected results

Hello, I am trying to compare two strings but am not getting the results that I should.

In this picture I am write-lining the two variables that I am looking to compare, as you can see both values are 144.49.
image

I then use an assign activity to compare the two variables, assign the value to boolean1 that is returned, and should either get back true/false.

image

In this case, I am getting back false but I should be getting true since both values are the same. Can anyone please tell me what I am doing wrong?

Here is the code in my assign activity: string.Equals(Emailtotalpricestring,Totalpdfpricestring) and both of these variables contain the same value

Thank you!

1 Like

@kdrumz Welcome to uipath community

I guess there is a space in one variable so try with below condition

If(Variable1.ToString.Trim=Variable2.ToString.Trim)
{
True
}
Else
{
False
}

Let me know for future help

1 Like

@kdrumz give atry on yourstrvar1.equals(yoirstrvar2) and feel free to incorporated trim function as well

1 Like

That worked! Thanks so much! @indra