I'm able to convert a character to its corresponding character/ASCII code using "Asc(CHAR)". What can I use to convert this returned integer back to its original character form?
ToByte() can be used. Convert. ToByte(character): This function will return ASCII Value of given character.
The Chr function converts the specified ANSI character code to a character. Note: The numbers from 0 to 31 represents nonprintable ASCII codes, i.e. Chr(10) will return a linefeed character.
ASCII is a 7-bit character set containing 128 characters. It contains the numbers from 0-9, the upper and lower case English letters from A to Z, and some special characters. The character sets used in modern computers, in HTML, and on the Internet, are all based on ASCII.
The Chr
function in VB.NET converts the integer back to the character:
Dim i As Integer = Asc("x") ' Convert to ASCII integer. Dim x As Char = Chr(i) ' Convert ASCII integer to char.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With