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 : )

the compareTo function in String class compares two strings lexicographically.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.