ADO DOT NET Posted July 27, 2009 Posted July 27, 2009 Hi, I have a single line of code in VB6 which I wanna convert to .NET: Here is my VB6 code: If CDbl(Right(Results, 1)) = 0 Then Rights = 500 I already have converted it and here it is: If Convert.ToDouble(Results.ToString.Substring(Results.ToString.Length - 1, 1)) = 0 Then Rights = 500 Just to make sure if I converted correctly and there is no shorter/better way specially for Right$ function, please let me know if my conversion is OK? Thank you very much. Quote
Administrators PlausiblyDamp Posted July 27, 2009 Administrators Posted July 27, 2009 What data type is Results? If it is already a string then you can drop the .ToString calls on it - other than that it is pretty much the correct way. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.