Im doing some string manipulation in VB.NET. In previous versions of VB, if you wanted to covert something to String you would use the CStr(or ToString, if available). Now in .NET, since everything is more object based, you can use the ToString everywhere.
Not so fast my friends.....
The catch is if what youre manipulating is null /or nothing. Where youll receive errors, if you try and use any of the string instance methods. Obviously the solution is to do an Is Nothing check on what youre manipulation. Where the CStr and all its old VB6 cowarts(CBool, CDate, CInt, etc.) dont care.
Im trying to get away from using on VB6 stuff(especially since Microsoft has taken other stuff from VB6 and not included it all), and use what VB.NET provides. It just seems like a step backward having to do an Is Nothing check anytime I want to convert data types.
If anyone has found some ways around this /or information on this, please share.
Thanks.
Not so fast my friends.....
The catch is if what youre manipulating is null /or nothing. Where youll receive errors, if you try and use any of the string instance methods. Obviously the solution is to do an Is Nothing check on what youre manipulation. Where the CStr and all its old VB6 cowarts(CBool, CDate, CInt, etc.) dont care.
Im trying to get away from using on VB6 stuff(especially since Microsoft has taken other stuff from VB6 and not included it all), and use what VB.NET provides. It just seems like a step backward having to do an Is Nothing check anytime I want to convert data types.
If anyone has found some ways around this /or information on this, please share.
Thanks.