ListHelper.cs 648 B

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