c# - Autochange implicit variable declaration to explicit -


i'm going convert c# code java converter tool doesn't understand var. so, before conversion, need change this

var array = new string[] {"a", "b", "c"}; 

to this

string[] array = new string[] {"a", "b", "c"}; 

automatically code. how can that?

automatically? can use resharper in order achieve it.

while caret positioned on var keyword, alt+enter give you:

specify type explicitly

and if want automate , apply modification on of source-code files, use clean-up feature:

resharper -> tools -> cleanup code -> create new profile/modify existing 1 , navigate c#->use 'var' in declaration. set "replace direction" "can (change) 'var' type usage" , "local variable declaration style" "always use explicit type".


Comments