🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #15804

Re: what class can convert "int" to ASCII?

#15804
From: Jason Burton
Date: Fri, 30 Apr 1999 00:00
13 lines
1123 bytes
> Thank you much. But what I want is the 7 bits ascii character. For
> instance, in VB, Chr(12) should give me "c" and Chr(17) is "h".
> Integer.toString(17) will give me "17".

You can typecast an integer directly to a character, though the integer 12
won't give you a "c".  Check an ASCII chart for the actual values.

int myInt = 72;
char myChar = (char)MyInt;  // typecast int to char
System.out.println(myChar); // will print out the ASCII value 72 as a
character

Jason
Technical Details
Message-ID: <7gcdqg$qkj12@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <37274CDA.FC4F47C5@TowerComInc.com> <37281610.36B6@cwcom.co.uk> <3729B63A.6EA006DD@TowerComInc.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,c3bdf6870c3c1ce2
X-Google-Attributes: gidf74b3,public
From: "Jason Burton" <Jason.Burton@McLeodSoftware.com>
Subject: Re: what class can convert "int" to ASCII?
Date: 1999/04/30
Message-ID: <7gcdqg$qkj12@forums.borland.com>
X-Deja-AN: 472695508
References: <37274CDA.FC4F47C5@TowerComInc.com> <37281610.36B6@cwcom.co.uk> <3729B63A.6EA006DD@TowerComInc.com>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Organization: Another Netscape Collabra Server User
X-MSMail-Priority: Normal
Newsgroups: borland.public.jbuilder.java.language