ListHelper.cs 571 B

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