Assign Specific Dataype in case of var

31 views Asked by At

How To assign Specific Data type instead of var in Following case

var provider = CultureInfo.InvariantCulture;
2

There are 2 answers

0
Osama AbuSitta On BEST ANSWER

In visual studio you can see the type when hover on the var keyword :

CultureInfo provider = CultureInfo.InvariantCulture
0
huse.ckr On
CultureInfo nonInvariantCulture = new CultureInfo("en-US");
Thread.CurrentThread.CurrentCulture = nonInvariantCulture;