Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

i'm not lazy i'm just resting before i get tired.
  • Leaders
Posted

or using the encoding method .....

       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))

Posted

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))

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...