My current code kind of looks like code below (details excluded). I would like to capture the output of the for each loop into a variable so that I can use it further in the program. Please guide.
- static void Main(string[] args)
- {
- foreach (example)
- {
- if (condition 1)
- {
- }
- if (condition 2)
- {
- }
- if (condition 3)
- { PrintServieChar();
- }
- Console.WriteLine(Environment.NewLine);
- }
- }