I usually define my string variables in vb.net as
Dim f_sName as string=String.Empty
f_sName = "foo"
Given the unchanged nature of strings in .net, is there a better way to initialize strings and the Variable processing f_sName is used before it has been assigned a value. A null reference exception might occur at runtime. "Warning?
Also for classes that don't have constructors that take no arguments, such as System.Net.Sockets.NetworkStream, what is the best way to define and initialize a variable of this type?
klork source
share