Mega Code Archive

 
Categories / VB.Net / Development
 

Convert ToString (Char) converts Unicode character to string

Class Sample    Public Shared Sub Main()     Dim stringVal As String ="rntsoft.com"     Dim charVal As Char = "a"c     Try         charVal = System.Convert.ToChar(stringVal)         System.Console.WriteLine("{0} as a char is {1}",stringVal, charVal)     Catch exception As System.FormatException         System.Console.WriteLine("FormatException")     Catch exception As System.ArgumentNullException         System.Console.WriteLine("The string is null.")     End Try     stringVal = System.Convert.ToString(charVal)     System.Console.WriteLine("The character as a string is {0}",stringVal)     End Sub  End Class