![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Expert Programmer
|
Int to String
In my program I need to change an int to a String. How can I do that?
__________________
|
|
|
|
|
|
#2 |
|
Expert Programmer
|
You can explicitly cast it to a String, or use the Integer.toString(int i) method.
|
|
|
|
|
|
#3 |
|
Programmer
|
one integer to a string or a list oof integers?
it it's one then I think you need to nail down the exact requirements a little more concrete than that. If it's an integer list then I would change it to characters using their acii representation.
__________________
-------------------- LOAD "*" ,8,1 God bless - Gryfang Last edited by gryfang; May 19th, 2006 at 8:35 PM. Reason: went from string to int not int to string |
|
|
|
|
|
#4 |
|
Expert Programmer
|
One int and titanium found the answer
__________________
|
|
|
|
|
|
#5 |
|
Newbie
Join Date: May 2006
Posts: 28
Rep Power: 0
![]() |
another easy trick way of doing it
int i = 5; String str = "" + i; |
|
|
|
|
|
#6 |
|
Programmer
|
Glad you got your solution
, sorry I went the wring direction with the conversion though .
__________________
-------------------- LOAD "*" ,8,1 God bless - Gryfang |
|
|
|
|
|
#7 |
|
Expert Programmer
|
How do I turn a String into a Double?
__________________
|
|
|
|
|
|
#8 |
|
Expert Programmer
|
The following code makes it an integer but i need it to be a double how do i do that?
String some number = "1"; somenumber = Integer.parseInt(num1);
__________________
|
|
|
|
|
|
#9 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 770
Rep Power: 3
![]() |
Double.parseDouble(s)
|
|
|
|
|
|
#10 |
|
Expert Programmer
|
Thanks
__________________
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|