Files
jellyfin-jellyfin-1/MediaBrowser.Model/Extensions/ListHelper.cs

42 lines
1007 B
C#
Raw Normal View History

2014-06-04 22:32:40 -04:00
using System;
namespace MediaBrowser.Model.Extensions
{
public static class ListHelper
{
2014-06-29 15:59:52 -04:00
public static bool ContainsIgnoreCase(string[] list, string value)
2014-06-04 22:32:40 -04:00
{
if (value == null)
{
throw new ArgumentNullException("value");
}
2017-08-24 15:52:19 -04:00
foreach (var item in list)
{
if (string.Equals(item, value, StringComparison.OrdinalIgnoreCase))
{
return true;
}
}
return false;
2014-06-04 22:32:40 -04:00
}
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;
}
2014-06-04 22:32:40 -04:00
}
}