I want to make a list from Enumerable.Range. Is this code correct?
SurnameStartLetterList = new List<char>();
Enumerable.Range(65, 26).ToList().ForEach(character => SurnameStartLetterList.Add((char)character));
Or is there a better way to make this type of list?
Maybe like this?
var surnameList = Enumerable.Range('A', 'Z' - 'A' + 1).
Select(c => (char)c).ToList();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With