ListHelper.cs 597 B

12345678910111213141516171819202122232425
  1. using System;
  2. namespace MediaBrowser.Model.Extensions
  3. {
  4. // TODO: @bond remove
  5. public static class ListHelper
  6. {
  7. public static bool ContainsIgnoreCase(string[] list, string value)
  8. {
  9. if (value == null)
  10. {
  11. throw new ArgumentNullException(nameof(value));
  12. }
  13. foreach (var item in list)
  14. {
  15. if (string.Equals(item, value, StringComparison.OrdinalIgnoreCase))
  16. {
  17. return true;
  18. }
  19. }
  20. return false;
  21. }
  22. }
  23. }