Guest User

Untitled

a guest
Mar 23rd, 2021
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | None | 0 0
  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.             Console.WriteLine(cronweek);
  16.  
  17.         }
  18.  
  19.         public IEnumerable<bool> GetInputs()
  20.         {
  21.             return new[] { true, false, true, false, true, true, true };
  22.         }
Advertisement
Add Comment
Please, Sign In to add comment