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);
- }
- }

Khaja MoizuddinRank #270 · 9.4K reputationPosted Aug 1, 2018, 7:51 PM EDT
Jaish MathewsRank #225 · 11K reputationPosted Aug 1, 2018, 8:46 PM EDT
Pravat KumarRank #2,456 · 573 reputationPosted Aug 1, 2018, 8:48 PM EDT
Karthik Chintala194 reputationPosted Aug 2, 2018, 12:23 AM EDT
Ram PrasadRank #4,848 · 322 reputationPosted Aug 2, 2018, 6:33 PM EDT