DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Java (http://www.daniweb.com/forums/forum9.html)
-   -   How to get a value from a string variable (http://www.daniweb.com/forums/thread160496.html)

NewbProgramma Dec 3rd, 2008 1:52 am
How to get a value from a string variable
 
I'm coding for fun and I can't figure out how to compare two string in an if (string1 < string2) type statement. I figured if I could somehow get values for those strings it would be easy to do the if statement.
All help is highly appreciated : )

verruckt24 Dec 3rd, 2008 2:31 am
Re: How to get a value from a string variable
 
the compareTo function in String class compares two strings lexicographically.

Read javadocs for more details, I'm sure they would help.


All times are GMT -4. The time now is 7:58 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC