Converting a character code to char (VB.NET)

后端 未结 4 1180
孤城傲影
孤城傲影 2020-12-30 19:57

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 characte

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-30 20:36

    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.
    

提交回复
热议问题