Find string in another string variable

Hi Everyone,

I am having 2 string variables. - PortofLoading, Comp_val
And these variable values get auto populated.

So now if I want to find the -string present in side the variable - PortofLoading,
in this variable - Comp_Val
Below is the code i wrote.
Comp_Val.ToString.Contains(PortOfLoading)
Unfortunately its not working.
I dont know why

Ex : PortofLoading has - ‘MANILA, PHILIPPINES’

Comp_Val has the below value in it
image
Please help.

Regards,
Seema

Both string are different
Portoflanding ‘MANILA, PHILIPPINES’
Comp_Val is ‘MANILA ,PHILIPPINES’

1 Like

@GBK

YEAH ,
u are right both are different. My main task is to find the - Portofloading in Comp_val
these both string for every transactions keep chainging

  • you can remove/replace , from both strings and try to compare again. It will return True.

@GBK

Okay, But everytime the both the strings are going to be different , for each transaction.
I am having around 200 to 300 records/transactions

there could be one more option to use regex to ignore , and compare two strings.