Possible Duplicate:
Use of var keyword in C#
I don't really understand why you would the var
keyword in C#
This code:
var s = "my string";
is the same as:
string s = "my string";
Why would you want to let the compiler determine the best type to use. Surely you should know what type to use. After all you are writing the code?
Isn't it clearer/cleaner to write the second piece code?