Asc Function in VB.NET
How to Convert String to Ascii code in VB.NET?
Asc() Function in VB.NET - Convert String to AsciiAsc Function in Visual Basic.net 2008
is used to return the character ascii code for the first character in the string.
Function Asc(ByVal String As Char) As Integer
In the above syntax, String
specifies the string whose first character is used to return the character
Console.WriteLine("Character Code of B
in Box is::" & Asc("Box"))
Console.WriteLine("Character Code of A
in A is::" & Asc("A"))
Character Code of B in Box is:: 66
Character Code of A in A is:: 65
In the above example, the character ascii code for 'B' and 'A' are returned as '66' and '65' respectivley.
Convert a string to its ASCII representation may be useful when you're producing the code for HTML forms with hidden/visible field.