Extract a value from the datatable based on a string

Hello,
I have a string str = “ABC xyz DEF”. I have a datatable dt1 such as
Col1,Col2
xyz, 1
pqr, 2
I want to extract col2 value 1 based on the string str.
I can try foreach loop but I want to know if I can pass any query.

I got this

@Chand
Filter Datatable with the condition column1 Startswith Str Could be an Option. Later with a Check that only 1 row ist filtered Out dtfiltered.rows(0)(col2) Let you Grab the value

1 Like

ok let me change my question. ‘Starts with’ probably will not work

@Chand
If contains will Not solve then please give some more Details in the scenario. Still WE have Other Options available e.g. select expressions or linq