ascii

not sure if it's the easiest but

Visual Basic:
Dim c As Char = "A"c
Dim b() As Byte = System.Text.ASCIIEncoding.ASCII.GetBytes(c)
MessageBox.Show(b(0).tostring)
 
the conversion from string to character doesn't work like it does in vb apparently
i got my code to work but now im curious as to i how convert "A" to a char quickly and easily since char c = "A"c; doesn't work
what's the deal?
 
or using the encoding method .....
Visual Basic:
        Dim b() As Byte = Encoding.ASCII.GetBytes("A".ToCharArray)
        Dim s() As Byte = Encoding.ASCII.Convert(System.Text.Encoding.UTF8, System.Text.Encoding.ASCII, b)
        MessageBox.Show(s(0))
 
I'm not totally sure whether this method is what u are looking for..
But here is it..


Dim myCon As Char
myCon = "a"
TextBox1.Text = Convert.ToString(Convert.ToInt32(myCon))
 
heh well i guess i left out the part that i'm using c#

i want the c# = to this Dim c As Char = "A"c
 
Back
Top