This site requires JavaScript, please enable it in your browser!
Greenfoot back
JetLennit
JetLennit wrote ...

2013/5/20

charAt(int) for integers

JetLennit JetLennit

2013/5/20

#
Does charAt(int) work with integers? If not, than is there something similar that does?
bourne bourne

2013/5/20

#
This should work: (myInt + "").charAt(int)
danpost danpost

2013/5/20

#
int testValue = 254; char c = (""+testValue).charAt(1); // c is set to '5'
JetLennit JetLennit

2013/5/20

#
Thank you both!
You need to login to post a reply.