Contains string not working

Hi, I am trying to get partial match by using contains.

E.g
a string: MINISTRYOFMANPOWER(MOM)
b string: MINISTRYOFMANPOWER

However, when I used if to see a contains b, it is going to else side.

This is how my workflow looks like:


Pls help

Thank you xoxo

@sangasangasanga

Could you please try to print a and b values before IF condition and see.

@lakshman yes I did. It seems to be okay, but there is no match :frowning:

@sangasangasanga

Try like this:

b.contains(a)

Sorry, the previous pic is wrong
image

1 Like

Try:
a.contains(b)

I tried but in vain

Hi @sangasangasanga

Can you please Trim both string values and check a contains b or not. A single space can give you wrong result. Please Trim and check.

Regards,
Vijay.

Buddy try like this buddy
a.contains(b.ToString.Trim)
This will work for sure…
Cheers @sangasangasanga

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