Filter out Data table question

Hi,
In filter datatable, I need to filter out values “S1” Or “S2” to S10. That is with one or two digits after S. Is there a way to specify this rule?

Thanks much,

Hi @A_Learner,

Could you elaborate a little more on what exactly you want to do?

Regards,
MY

Col1 has values like “ABC-S1”, “ABC-S2”, “XYZ-SEER”. So I need to remove rows with Col1 ending with “S1”, that is S and a digit.

Thank you,

Hey

did you mean something like this?

image

Regards!

Yes, do I have to list all S1 to S10?

Thank you,

You can use this.

do a while loop and the filter with that

FilteredDT = dt.AsEnumerable.Where(function(x) x("yourColumn").ToString.Trim.ToLower.Contains("S" + Counter.ToString)).CopyToDataTable

Regards

1 Like

Thank you!! @fernando_zuluaga

1 Like

But I need to eliminate these rows.

FilteredDT = dt.AsEnumerable.Where(function(x) Not(x("yourColumn").ToString.Trim.ToLower.Contains("S" + Counter.ToString))).CopyToDataTable

add “not” at the end of the function

Got it! Thanks @fernando_zuluaga, @muhammedyuzuak

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