Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Checking If Var is in Range/List
#1
When you were going through the IfElse statements for this week using letters, I was trying to look up if there was a way to see if a letter was in 'a':'z' without having to type everything individually in the IfElse? Is there a way to do that? I found this bit of code online, but I couldn't understand what it was doing..

Code:
var list = Enumerable.Range('a', 'z' - 'a' + 1).Select(c => (char)c).ToList();
Reply




Users browsing this thread: 1 Guest(s)