Article View: borland.public.jbuilder.java.language
Article #16902Re: Converting from ASCII
From: matt lopresti
Date: Wed, 30 Dec 1998 00:00
Date: Wed, 30 Dec 1998 00:00
19 lines
1126 bytes
1126 bytes
i got it:
String text = new String(numAsArray);
this is from constructor String(byte[] bytes);
Thanks.
matt lopresti wrote:
> i am writing a program that takes in a phone number, and converts it to
> letters, as to make the phone number easier to remember. I have taken
> the phone number and converted to getBytes, this assigns the ASCII value
> to the numbers, the Question is: how then do I convert it back? Here is
> the code snippet:
>
> String phoneNumber ="6479037";
> byte[] numAsArray = phoneNumber.getBytes();
>
> Thank you advance,
> -Matt
Technical Details
Message-ID:
<368ABD4F.B61FDEA2@toad.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<36880E9A.7A2C8F8@toad.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,b7f932c95abe3579 X-Google-Attributes: gidf74b3,public From: matt lopresti <loprestim@toad.net> Subject: Re: Converting from ASCII Date: 1998/12/30 Message-ID: <368ABD4F.B61FDEA2@toad.net> X-Deja-AN: 427284958 Content-Transfer-Encoding: 7bit References: <36880E9A.7A2C8F8@toad.net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language