Convert.ToChar (Int64) converts 64-bit signed integer to Unicode character. : Convert to Char « Development « VB.Net






Convert.ToChar (Int64) converts 64-bit signed integer to Unicode character.

  
Class Sample
   Public Shared Sub Main()

        Dim longVal As Long = 999999999999
    
        Dim charVal As Char = "a"c
    
        Try
            charVal = System.Convert.ToChar(longVal)
            System.Console.WriteLine("{0} as a char is {1}", _
                                      longVal, charVal)
        Catch exception As System.OverflowException
            System.Console.WriteLine( _
                "Overflow in Long-to-Char conversion.")
        End Try
    
        ' A conversion from Char to Long cannot overflow.
        longVal = System.Convert.ToInt64(charVal)
        System.Console.WriteLine("{0} as a Long is {1}",charVal, longVal)
    End Sub
End Class

   
    
  








Related examples in the same category

1.Convert.ToChar (Byte) converts 8-bit unsigned integer to Unicode character.
2.Convert.ToChar (Int16) converts 16-bit signed integer to Unicode character.
3.Convert.ToChar (Int32) converts 32-bit signed integer to Unicode character.
4.Convert.ToChar (Object) converts object to a Unicode character.
5.Convert.ToChar (SByte) converts 8-bit signed integer to Unicode character.
6.Convert.ToChar (String) converts the first character of a string to a Unicode character.
7.Convert.ToChar(String,IFormatProvider) converts the first character of string to a Unicode character with culture format
8.Convert.ToChar (UInt16) converts 16-bit unsigned integer to Unicode character.
9.Convert.ToChar (UInt32) converts 32-bit unsigned integer to Unicode character.
10.Convert.ToChar (UInt64) converts 64-bit unsigned integer to Unicode character.