Find "&" mark

Hi

I take data from the excel using assessing activity to the string variable
I need to check is there any “&” in that variable(& mark can be in any position)

If there is & mark I need to send message

Data take from excel
Ex:- P&DGROU-01

& mark can be in any position

Thank you

please let us know when YourString.Contains("&") is not working for your scenario

1 Like

Hello @Lochana_Bandusena ;

Hope you need to search in the entire excel and if its present you need to send the email. Do you need to send the occurence also? You can do as below.

Read Range Activity-Read the excel sheet and store output in a datatable variable.
Output Data Table Activity- convert the datatable to a string variable, suppose it “MyData”
perform contains operation on that string to figure out if your search string exists in the excel sheet. MyData.Contains("&")

2 Likes

Thank you Its work

Thank you Its work

1 Like

@Lochana_Bandusena
in case that in all columns is to look for the & we can do it within an oneliner:

dtData.asEnumerable.Any(Function (x) x.ItemArray(c) c.toString.Contains("&"))
it will retrurn true if it is found 1 or more times in any row in any col

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