aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Extensions/ListHelper.cs
blob: b893a3509a045a82388d68c03077651865a371dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#nullable disable
#pragma warning disable CS1591

using System;

namespace MediaBrowser.Model.Extensions
{
    // TODO: @bond remove
    public static class ListHelper
    {
        public static bool ContainsIgnoreCase(string[] list, string value)
        {
            if (value == null)
            {
                throw new ArgumentNullException(nameof(value));
            }

            foreach (var item in list)
            {
                if (string.Equals(item, value, StringComparison.OrdinalIgnoreCase))
                {
                    return true;
                }
            }

            return false;
        }
    }
}