ListHelper.cs 742 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. namespace MediaBrowser.Model.Extensions
  5. {
  6. public static class ListHelper
  7. {
  8. public static bool ContainsIgnoreCase(List<string> list, string value)
  9. {
  10. if (value == null)
  11. {
  12. throw new ArgumentNullException("value");
  13. }
  14. return list.Contains(value, StringComparer.OrdinalIgnoreCase);
  15. }
  16. public static bool ContainsIgnoreCase(string[] list, string value)
  17. {
  18. if (value == null)
  19. {
  20. throw new ArgumentNullException("value");
  21. }
  22. return list.Contains(value, StringComparer.OrdinalIgnoreCase);
  23. }
  24. }
  25. }