I use:

public static string GoFlig() { List<int> sv = new List<int>(); for (int i = 1; i < 50; i++) { sv.Add(i); } return string.Join(" ", sv.ToArray()); } 

I call the function as html table)

 using (StreamWriter vas = new StreamWriter(Log, false, Encoding.UTF8)) { vas.WriteLine("<tr><td style=\"color:#85AB70; width:33.3%; border:2px solid #707070; text-align: center\"><div style=\"height: 31px;line-height: 31px\"><center>{0}</center></p></div></td>", GoFlig()); } 

But it turns out like this:

enter image description here

Tell me where to put the for loop so that it returns values:
In the end, I should get this:

one
2
3
four
etc

Addition The result of the work proposed by @Foggy Finder, enter image description here

  • one
    Is the code exactly as written or did you simplify it? - user227049 Nov.
  • Exactly this, I can not figure out where you can put the for loop and try to call it in StringBuilder same story. - GooliveR
  • one
    Let's just show you a more complete code. Such a result simply could not work without an external loop. - user227049
  • Yes, external cycles are used there, but I will not show a more complete code, as it is very secret)) Just StringBuilder where it is possible by List<int> and StringBuilder add a for ?? loop! - GooliveR
  • @Foggy Finder, If you can make a list out of it, then maybe it’s possible, I don’t know if there is an opportunity to demonstrate it ?! Maybe go to the chat? - GooliveR

0