A monkey that actually turned out to be not evil...
Monday, January 24, 2011
Converting a number variable into a string 1/24/11
When converting a number variable such as an integer we use the 'ToString' command. You can do it this way and also a different way by using the 'CStr' command. Here I show both ways.
This is the 'ToString' command.
Dim intYahoo As Integer = 8
Dim strYahoo As String = intYahoo.ToString
This is the 'CStr' command.
Dim intYahoo As Integer = 8
Dim strYahoo As String = CStr(intYahoo)
I like the explanation and the flow. However, I would like to see more complete code demonstrating the use of each way though:
ReplyDeleteDim intYahoo As Integer = 8
Dim strYahoo As String = CStr(intYahoo)
or
Dim intYahoo As Integer = 8
Dim strYahoo As String = intYahoo.ToString