This does not seem to be a problem:
List<int> steporders = new List<int>(); for (int i = 1; i <= 10; i++) { steporders.Add(i); }
But I see there a simpler, better or smarter way that I did not think about. There is?
Yes, you can do it easily:
List<int> steporders = Enumerable.Range(1, 10).ToList();
My friend always thought I should not answer questions before I find out what this is about: you have one of them :)
Why do you need a list with numbers from 1 to 10? This seems completely useless (at least without any context).
Source: https://habr.com/ru/post/1726088/More articles:Slow operation when selecting the next message from the user queue - sortingPyTables problem - different results when repeating over a subset of a table - pythonOracle Tuning / Analysis Tables - performancePreventing RegEx freeze in big matches - pythonWhat is the easiest, most portable way to send an email to elisp? - emailBash Syntax: What is "<<"? - syntaxIs there a way to specify $ GlobalRev $ in a file using Subclipse for Eclipse - eclipseNSSavePanel: Suppression of "replacement confirmation"? dialogue - cocoaЗамена объединенных ресурсных словарей при загрузке приложения Silverlight - c#How to get a list of subscribers for an event at runtime? - c #All Articles