Check if string contains text from an array without using for each?

check if string contains text from an array without using for each

Input : 1234 boulevard street
array = {street, avenue , road}
output = true → input has street

Input : 1234 boulevard traft
array = {street, avenue , road}
output = false -->> the input does not contain any item from an array

is there a way we can check this without using for each ?

Hi @AhmedKutraphali

Yes Let me share the code with you

Thank you

okay @PRASHANT_GABHANE

grafik

yourArrayVar.Any(Function (x) YourStringVar.Contains(x))

1 Like

can you please post the code @ppr , so I can easily copy it instead of the image . Thank you .

thanks

Hi @AhmedKutraphali
Array.Find(arr,Function (Strr) Strr.ToString.Contains(“searchitem”))

Thanks

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