Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 402
  • Last Modified:

How convert text string to asc text in vb.net2010

eg. a="202020" need to convert to "   "

May I know how to make it, thanks.
0
turbot_yu
Asked:
turbot_yu
  • 2
2 Solutions
 
guveraCommented:
Hi,

 Please try the below code.

        Dim strSource As String
        Dim bteEndode() As Byte
        Dim myFileStream As New FileStream("test.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite)


        strSource = "asdf"
        bteEndode = Encoding.ASCII.GetBytes(strSource)
 
       
        myFileStream.Write(bteEndode, 0, bteEndode.Length)
 
        myFileStream.Close()

Hope it may helpful to you.

Regards
Guvera
0
 
guveraCommented:
Also please find the below link for more details about this query.

 http://msdn.microsoft.com/en-us/library/system.text.encoding.aspx

Regards
Guvera
0
 
ASP8MBMCommented:
hope this helps:

        Dim arrByte As Byte() = Encoding.ASCII.GetBytes(TextBox1.Text)
        Dim strSB As New StringBuilder

        For Each bite As Byte In arrByte
            strSB.Append(bite & " "c)
        Next
        TextBox2.Text = strSB.ToString
0
 
turbot_yuAuthor Commented:
it is now already convert to "533132333435363741202020" in string(by Hex(abNum(i))), I need to convert it back to "abc.....".
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now