You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

24 lines
604 B

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace HBLConsole.Service
  7. {
  8. public static class ExpandMethod
  9. {
  10. public static int GetIndex(this bool[] obj, bool value)
  11. {
  12. if (obj == null) return -1;
  13. return Array.FindIndex(obj, p => p == value);
  14. }
  15. public static int GetIndex(this string[] obj, string value)
  16. {
  17. if (obj == null || value == null) return -1;
  18. return Array.FindIndex(obj, p => p == value && p.Length > 0);
  19. }
  20. }
  21. }