off topic - how do i convert an int to char

2004-12-07 Thread Nilesh Bhattad
folks, sorry for posting this offtopic qns here.. but would someone plz help me out in converting an int value to char? my requirement is very simple. i'm looping thro a list and for each counter i need to get 'a', 'b' and so forth. basically i need some conversion routine which will convert 0

Re: off topic - how do i convert an int to char

2004-12-07 Thread Yang Xiao
make a hash or array? On Tue, 7 Dec 2004 10:34:15 -0500, Nilesh Bhattad [EMAIL PROTECTED] wrote: folks, sorry for posting this offtopic qns here.. but would someone plz help me out in converting an int value to char? my requirement is very simple. i'm looping thro a list and for each

RE: off topic - how do i convert an int to char

2004-12-07 Thread Brantley Hobbs
Users List Subject: Re: off topic - how do i convert an int to char make a hash or array? On Tue, 7 Dec 2004 10:34:15 -0500, Nilesh Bhattad [EMAIL PROTECTED] wrote: folks, sorry for posting this offtopic qns here.. but would someone plz help me out in converting an int value to char

Re: off topic - how do i convert an int to char

2004-12-07 Thread Nilesh Bhattad
- From: Yang Xiao [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, December 07, 2004 10:42 AM Subject: Re: off topic - how do i convert an int to char make a hash or array? On Tue, 7 Dec 2004 10:34:15 -0500, Nilesh Bhattad [EMAIL PROTECTED] wrote: folks, sorry

RE: off topic - how do i convert an int to char

2004-12-07 Thread Brantley Hobbs
Wow, was I off. Add a 97 to your int value to get the lower-case English letters. B. -Original Message- From: Brantley Hobbs Sent: Tuesday, December 07, 2004 10:50 AM To: Tomcat Users List; Yang Xiao Subject: RE: off topic - how do i convert an int to char Alternatively, you can

RE: off topic - how do i convert an int to char

2004-12-07 Thread Peter Crowther
From: Nilesh Bhattad [mailto:[EMAIL PROTECTED] Subject: Re: off topic - how do i convert an int to char Oh, come on. String letterAt(int i) { return abcdefghijklmnopqrstuvwxyz.substring(i, i + 1); } Fast, portable, simple. - Peter

Re: off topic - how do i convert an int to char

2004-12-07 Thread Nilesh Bhattad
Thanks!!! that worked !! - Original Message - From: Brantley Hobbs [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED]; Yang Xiao [EMAIL PROTECTED] Sent: Tuesday, December 07, 2004 10:54 AM Subject: RE: off topic - how do i convert an int to char Wow, was I off. Add a 97 to your

RE: off topic - how do i convert an int to char

2004-12-07 Thread Robert Harper
Users List; Yang Xiao Subject: RE: off topic - how do i convert an int to char Alternatively, you can add the ASCII offset to the integer, then get the char that evaluates to that ASCII code. I think its 32, but you'll need to check for sure. B. -Original Message- From

RE: off topic - how do i convert an int to char

2004-12-07 Thread Brantley Hobbs
11:01 AM To: Brantley Hobbs; Yang Xiao Cc: Tomcat Users List Subject: Re: off topic - how do i convert an int to char Thanks!!! that worked !! - Original Message - From: Brantley Hobbs [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED]; Yang Xiao [EMAIL PROTECTED] Sent

Re: off topic - how do i convert an int to char

2004-12-07 Thread Parsons Technical Services
: Re: off topic - how do i convert an int to char That would be the last solution if i dont get any other better way of doing it... i tried with Character.forDigit(97, 2) hoping to get 'a' back but it returned 0... i'm not sure which radix does it expect as a 2nd argument. btw Yang, thanks

Re: off topic - how do i convert an int to char

2004-12-07 Thread Filip Hanik - Dev
am I being silly? char ch = (char)myint; Filip - Original Message - From: Robert Harper [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Tuesday, December 07, 2004 10:01 AM Subject: RE: off topic - how do i convert an int to char The offset starts at '0' == 48 ( 0x30

RE: off topic - how do i convert an int to char

2004-12-07 Thread Caldarale, Charles R
From: Parsons Technical Services [mailto:[EMAIL PROTECTED] Subject: Re: off topic - how do i convert an int to char Cast it with the offset added. int i = 0; char ch = (char)(i+97); Or if you want to make it a little more understandable: char ch = (char) (i + 'a'); Note

Re: off topic - how do i convert an int to char

2004-12-07 Thread Adam Smith
- how do i convert an int to char folks, sorry for posting this offtopic qns here.. but would someone plz help me out in converting an int value to char? my requirement is very simple. i'm looping thro a list and for each counter i need to get 'a', 'b' and so forth. basically i need some