Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2021
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public void test()
  2.         {
  3.             IEnumerable<bool> inputs = GetInputs();
  4.  
  5.             string cronweek = "";
  6.  
  7.             for (int i = 0; i < inputs.Count(); i++)
  8.             {
  9.                 if (inputs.ElementAt(i))
  10.                 {
  11.                     cronweek += $"{i},";
  12.                 }
  13.             }
  14.            
  15.             // 0,2,4,5,6,
  16.             Console.WriteLine(cronweek);
  17.            
  18.         }
  19.  
  20.         public IEnumerable<bool> GetInputs()
  21.         {
  22.             return new[] { true, false, true, false, true, true, true };
  23.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement