Joshua4550 Posted October 27, 2009 Share Posted October 27, 2009 Basically, i need to convert a String into an int, then convert the int back to a String (making it be the same). Is this possible? So i could have like "The car drove under the bridge". Then convert it to an int. Then convert the int back to a String. The String still equals "The car drove under the bridge". Please post ASAP Quote Link to comment https://forums.phpfreaks.com/topic/179241-java-sending-a-string-through-an-integer/ Share on other sites More sharing options...
Mchl Posted October 27, 2009 Share Posted October 27, 2009 String.getBytes() To decode just use String() constructor. (Or so manual says. I've never done it) Quote Link to comment https://forums.phpfreaks.com/topic/179241-java-sending-a-string-through-an-integer/#findComment-945705 Share on other sites More sharing options...
Maq Posted October 27, 2009 Share Posted October 27, 2009 Why can't you just cast it? Integer.parseInt(); Integer.toString(); Quote Link to comment https://forums.phpfreaks.com/topic/179241-java-sending-a-string-through-an-integer/#findComment-945708 Share on other sites More sharing options...
GingerRobot Posted October 28, 2009 Share Posted October 28, 2009 Why can't you just cast it? Integer.parseInt(); Integer.toString(); If you try that, i'm pretty sure you're going to get an exception thrown by the parseInt method. I think Mchl's suggestion should be good. Quote Link to comment https://forums.phpfreaks.com/topic/179241-java-sending-a-string-through-an-integer/#findComment-946264 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.