mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-07 11:57:55 +02:00
41 lines
1,007 B
C#
41 lines
1,007 B
C#
using System;
|
|
|
|
namespace MediaBrowser.Model.Extensions
|
|
{
|
|
public static class ListHelper
|
|
{
|
|
public static bool ContainsIgnoreCase(string[] list, string value)
|
|
{
|
|
if (value == null)
|
|
{
|
|
throw new ArgumentNullException("value");
|
|
}
|
|
|
|
foreach (var item in list)
|
|
{
|
|
if (string.Equals(item, value, StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|
|
}
|