How to get a value from a string variable

Thread Solved

Join Date: Dec 2008
Posts: 1
Reputation: NewbProgramma is an unknown quantity at this point 
Solved Threads: 0
NewbProgramma NewbProgramma is offline Offline
Newbie Poster

How to get a value from a string variable

 
0
  #1
Dec 3rd, 2008
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 : )
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 823
Reputation: verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough 
Solved Threads: 73
verruckt24's Avatar
verruckt24 verruckt24 is offline Offline
Practically a Posting Shark

Re: How to get a value from a string variable

 
0
  #2
Dec 3rd, 2008
the compareTo function in String class compares two strings lexicographically.

Read javadocs for more details, I'm sure they would help.
Last edited by verruckt24; Dec 3rd, 2008 at 2:34 am.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC