Monday, January 24, 2011

Converting A Number Variable to a String

 Public Class Form1
  
 
  
   Private Sub btnConvert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConvert.Click
  
     Dim number As Integer
  
     number = 97
  
 
  
     number.ToString()
  
 
  
     MessageBox.Show(number)
  
 
  
   End Sub
  
 End Class  

1 comment:

  1. The number.ToString() line actually doesn't do anything here. You would have to set it to a string variable like:

    Dim str as String = number.ToString()
    MessageBox.Show(str)

    Make that adjustment and this would be a good reference.

    ReplyDelete