DataTable Select mask no results #wildcard

Hello everyone, dear friends. I have a problem. I have a table that needs to be filtered by criteria. kr1 = “15”, kr2 = “???28*”. I use Select, but the criteria with the mask does not find results (Gives 0 results). In the case of kr1, this works. Attach a screenshot.


Table:
Name Weight
2562847895 15
4712811284 20
4795365178 15
7474611566 12
Thanks you!

@sergey_1996

Welcome to the UiPath community.

Please can you try the select with kr2 instead of Name and see how it goes.

Hi
this expression will help you get the result we want
datatable = datatable.AsEnumerable().Where(Function(a) a.Field(of string)(“Name”).ToString.Contains(“28”) AND a.Field(of string)(“Weight”).ToString.Contains(“15”)).CopyToDatatable()

Cheers @sergey_1996

Hi,

Can you try the following?

DT1=DT.AsEnumerable.Where(function(r) System.Text.RegularExpressions.Regex.IsMatch(r("Name").ToString(),"\d\d\d28\d*") and r("Weight").ToString="15" ).CopyToDataTable

Regards,

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