Hi there,
I am trying to parse thru a csv string, put the results into a IList collection and then trying to find a way to do a wildcard 'contains' based on what was passed in. Right now I have the following:
public static IList<string> DBExclusionList
{
get
{
Regex splitRx = new Regex(@",\s*", RegexOptions.Compiled);
String list = (string)_asr.GetValue("DBExclusionList",typeof(string));
string[] fields = splitRx.Split(list);
return fields;
}
}
if (DBExclusionList.Contains(dbx.Name.ToString())==false)
{...}
So if the string I am parsing (key value from .config file) contains: key="DBExclusionList" value="ReportServer,ReportServerTempDB,SQLSentry20,_TEST"
The DBExclusionList.Contains() works very well for exact matches on the first 3 items in the list, but I want to be able to ALSO have it for any partial match of the fourth item '_TEST'
is there any way to do it? I could certainly hardcode it to always exclude whatever but I'd rather not.
thanks.