mawingpui
asked on
Enumerable.Select
How to print only the digits from the ID field?
(without using basic substring and indexOf functions to check each ID)
(without using basic substring and indexOf functions to check each ID)
DataTable dt = new DataTable();
dt.Columns.Add("ID", typeof(String));
dt.Rows.Add("USB22345");
dt.Rows.Add("USC33399");
dt.Rows.Add("USD66777");
var query = from c in dt.AsEnumerable()
select c["ID"];
foreach (string item in query)
Console.WriteLine(item.Select(c => char.IsDigit(c)));
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.