I have a variable
int? a = Int32.TryParse(b);
How can I make it that a becomes a null if b is found not to be an integer?
This should work for you
int? a = int.TryParse(b, out var value) ? value : (int?) null;
you should use var instead of int?
var a = int.TryParse(b, out var value) ? value : (int?) null;