convert from AscW() integer to string

Dim A As String = "pimp"
        Dim B As Integer
        Dim C As String

        B = AscW(A)

        ' how do i convert B back to the string pimp
        C = 'B
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You can't.  Using a query such as that will only return the character code for the first letter.
ChrW(B) will demonstrate this and return "p".
sayethAuthor Commented:
Ok, what query can i use to convert string to a integer and be able to convert it back to a string
Not sure what you are intending to do but something like the code below may work.
Unfortunately I can't think of a better way of doing it right at the moment.
Dim CharacterCodes As New List(Of Integer)
For Each Character In A.ToCharArray
Dim RebuiltStringWriter As New System.IO.StringWriter
For Each CharacterCode In CharacterCodes
Dim RebuiltString = RebuiltStringWriter.ToString

Open in new window

OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

Mike TomlinsonHigh School Computer Science, Computer Applications, and Mathematics TeachersCommented:
What do you want to do with "B"?....

Maybe you need a Byte Array?

        Dim A As String = "pimp"
        Dim bytes() As Byte = Convert.FromBase64String(A)
        Dim C As String = Convert.ToBase64String(bytes)
        MessageBox.Show(A & " = " & C)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sayethAuthor Commented:
sorry i had a meeting. Ok
What do you want to do with "B"?....
Idle Mind:  I m using a predefine string in my interface and i can only store integer. so i need the store integer convert back to a string to show the user if they go back to that interface or not.  
If it is not possible, i will do it the the long way, using if else statement or case statement

Mike TomlinsonHigh School Computer Science, Computer Applications, and Mathematics TeachersCommented:
I'll go with "not possible" least not using anything built-in to the .Net framework.

Could you explain more about your interface and the storing of the value?...that doesn't make any sense at the moment.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.