How to check whether string is there or not


#1

Hi,
I want to check whether string is present or not… for example if string1=“Aparna_199901_-Fresher-_1” and string2=“Aparna”… i used if(string1.contains(string2)) but it throws else statement… if anyone knows help me


#2

I don’t see anything wrong in your logic considering the string values(Aparna) are exactly the same. Can you paste the screenshot?


#3

Hi there @Sunitha_Bist,
You are spot on with how to achieve this.

I have tested it in the below example and can confirm it works as expected:
Main.xaml (7.5 KB)

Can you provide any additional information?


#4

Use isMatch activity and pattern as (.* )string2(.* ) and input as string1
Use RegexOption as IgnoreCase

Return value : boolean


#5

Hi vvaidya, Mr_JDavey

Im getting error like this


#6

hi aksh1yadav,
Yup your ans is right thts way i changed and tried it… it got resloved


#7

Hi all,
Sorry I’m getting the answer… TQ FOR ALL


#8

have you check with is match in search pane?

Regards…!!
Aksh


#9

According to my perspective you are getting that because you are using throw activity to throw exception with user assigned exception message.

Regards…!!
Aksh