I want to iterate through the built-in types (bool, char, sbyte, byte, short, ushort, etc) in c#.
How to do that?
foreach(var x in GetBuiltInTypes()) { /
There's no built-in way to do that; you can try:
foreach (var type in new Type[] { typeof(byte), typeof(sbyte), ... }) { //... }
Of course, if you're going to be doing this a lot, factor out the array and put it inside a static readonly variable.
static readonly