Checking for culture in comma separated list, any suggestions? I have a basic class that I'd like to get some feedback on. I'm refactoring some old code but the new code looks more complex. Basically I'm passing a list of included and excluded cultures into a function that should return if the current culture should be allowed.  Exclusions win.  Any advice how to better it would be great.  Thanks

public static class CultureCheck
{
    public static bool IsCurrentCultureIncluded(string includedCultures, string excludedCultures)
    {
        if(includedCultures == null)
        {
            throw new ArgumentNullException("includedCultures");
        }

        if (excludedCultures == null)
        {
            throw new ArgumentNullException("excludedCultures");
        }

        var isIncluded = false;

        // exclusions win.
        if (IsCultureInList(excludedCultures) == true)
        {
            isIncluded = false;
        }
        else if(IsCultureInList(includedCultures) == true)
        {
            isIncluded = true;
        }

        return isIncluded;
    }

    private static bool IsCultureInList(string cultures)
    {
        string currentCultureName = Thread.CurrentThread.CurrentCulture.Name;
        var isFound = false;

        if (cultures.IndexOf("*") != -1)
        {
            isFound = true;
        }
        else
        {
            List&lt;string&gt; cultureList = new List&lt;string&gt;(cultures.Split(','));
            if (cultureList.Where(e =&gt; e.Equals(currentCultureName, StringComparison.InvariantCultureIgnoreCase)).Any() == true)
            {
                isFound = true;
            }
        }

        return isFound;
    }
}


OLD CODE

 public static bool IsCurrentCultureIncluded(string includedCultures, string excludedCultures)
    {
        #region Exclusion Test

        // exclusions win.
        if (excludedCultures.IndexOf("*") != -1)
        {
            return false;
        }

        string currentCultureName = Thread.CurrentThread.CurrentCulture.Name;
        string[] excludedCulturesSplit = excludedCultures.Split(new char[] { ',' });
        foreach (string excludedCulture in excludedCulturesSplit)
        {
            if (string.Equals(currentCultureName, excludedCulture, StringComparison.InvariantCultureIgnoreCase))
            {
                return false;
            }
        }

        #endregion

        #region Inclusion Test

        if (includedCultures.IndexOf("*") != -1)
        {
            return true;
        }

        string[] includedCulturesSplit = includedCultures.Split(new char[] { ',' });
        foreach (string includedCulture in includedCulturesSplit)
        {
            if (string.Equals(currentCultureName, includedCulture, StringComparison.InvariantCultureIgnoreCase))
            {
                return true;
            }
        }

        #endregion

        return false;
    }
I would do it like this (WARNING - not tested):

public static void SampleUsage()
{
    IsCurrentCultureIncluded("*", "*", Thread.CurrentThread.CurrentCulture.Name);
}

public static bool IsCurrentCultureIncluded(string includedCultures, string excludedCultures, string currentCultureName)
{
    return !CheckIncl(currentCultureName, excludedCultures) &amp;&amp;
            CheckIncl(currentCultureName, includedCultures);
}

private static bool CheckIncl(string currentCultureName, string includedCultures)
{
    if (includedCultures.IndexOf("*") != -1)
        return true;

    var includedCulturesSplit = includedCultures.Split(new[] { ',' });
    return includedCulturesSplit.Any(includedCulture =&gt; string.Equals(currentCultureName, includedCulture, StringComparison.InvariantCultureIgnoreCase));
}