Match value in a string

Hello,
I have a task to do…
I have to compare the value of two strings.
For eg:if String1 has a default value {“A”,“B”,“C”}
String2 will contain single value either A or B or C and sometimes none of these but D.

Please can you advice me a if condition where I can check value of string2 is available in string1
How can I check it

Hello @Mufaddal_Burhani

Below post, might help you solve your issue :point_down:

@mz3bel Thanks Buddy
But in my case string1 is array ans string2 is string a desired string value

1 Like

I want to check
for eg, array1= A, B, C
array2= A
then if condition to check value of array2 is present in array1
if condition is met then proceed to another step, else different step
please advice

1 Like

Try this Array1.Intersect(Array2).Any.ToString

@Mufaddal_Burhani, use Join method to get single string value and then use Contains method to check whether string exist or not.

Let me know if you need more detail.

Cheers

1 Like

@Bhavik_Solanki
it would be great if you can specify the condition

@Mufaddal_Burhani,
Following statement will return a Boolean value (i.e. True or False).

String.Join(",", strArray).Contains(stringVariable)

Cheers

1 Like