jellyfin/MediaBrowser.Model/Extensions/ListHelper.cs
2017-08-19 15:43:35 -04:00

37 lines
889 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
namespace MediaBrowser.Model.Extensions
{
public static class ListHelper
{
public static bool ContainsIgnoreCase(string[] list, string value)
{
if (value == null)
{
throw new ArgumentNullException("value");
}
return list.Contains(value, StringComparer.OrdinalIgnoreCase);
}
public static bool ContainsAnyIgnoreCase(string[] list, string[] values)
{
if (values == null)
{
throw new ArgumentNullException("values");
}
foreach (string val in values)
{
if (ContainsIgnoreCase(list, val))
{
return true;
}
}
return false;
}
}
}