tags:

views:

45

answers:

1

I have a List<SomeType> where

SomeType.Value = "TASK?" where '?' can be from 1 to N.

SomeType.Value can also have values like TASKCNT, TASKOLD etc..

The question is how do I Select all "TASK?" ignoring other values like TASKCNT, TASKOLD

Thanks in advance

+4  A: 

If this is a simple LINQ to objects, you can just use a regular expression:

var regex = new Regex(@"^TASK\d$");
var tasks = 
    from task in theTasks
    where regex.IsMatch(task.Value);
    select task;
Jacob