Is there a way to assign the ASCII values from a text box to a label on a form? Say the text box had the character "a" inputed, how would i translate that into its ASCII value? Also is it possible to do this with a string of characters? Say I typed "aaa" and wanted it to return the value of these 3 letters in a row, say they are valued at 2 digits. "xxXXxx" Where the first xx is the first a the XX is the second a and the 2nd xx is the last a? I know i could do this through a large serious of ifs but there has to be an easier way...
mark192
0
Newbie Poster
Recommended Answers
Jump to PostTo convert one char to ASCII value:
Dim ch As Char ch = "A" MessageBox.Show(Asc(ch))
or:
Dim ch As Char Dim intg as Integer ch = "A" intg = Asc(ch) MessageBox.Show(intg)
To convert a string to ASCII:
Dim str As String …
Jump to PostSure, just add each ASCII value to a new 'total' string:
Dim total As String = "" Dim str As String = "test" Dim cnt As Integer = 0 While cnt < str.Length total += Asc(str(cnt)).ToString + "-" cnt += 1 End While MessageBox.Show(str + " in …
Jump to PostThat's alot more difficult. How does this string look? Do you still have the delimiter ( - ) in it? Please show an example
All 10 Replies
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
mark192
0
Newbie Poster
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
mark192
0
Newbie Poster
mark192
0
Newbie Poster
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
mark192
0
Newbie Poster
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
SolTec
0
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.