jellyfin-server/MediaBrowser.Model/Extensions/ListHelper.cs

28 lines
629 B
C#
Raw Normal View History

2020-02-04 00:49:27 +00:00
#pragma warning disable CS1591
using System;
2018-12-27 23:27:57 +00:00
namespace MediaBrowser.Model.Extensions
{
2020-01-09 16:07:13 +00:00
// TODO: @bond remove
2018-12-27 23:27:57 +00:00
public static class ListHelper
{
public static bool ContainsIgnoreCase(string[] list, string value)
{
if (value == null)
{
throw new ArgumentNullException(nameof(value));
2018-12-27 23:27:57 +00:00
}
foreach (var item in list)
{
if (string.Equals(item, value, StringComparison.OrdinalIgnoreCase))
{
return true;
}
}
return false;
}
}
}