jellyfin/MediaBrowser.Model/Extensions/ListHelper.cs

28 lines
629 B
C#
Raw Normal View History

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