Ask your own question, for FREE!
Computer Science 18 Online
OpenStudy (anonymous):

What method do we use to see if one String object is less than another?

OpenStudy (harsha19111999):

We first find the length of the string using length() method and then use the if condition

OpenStudy (anonymous):

Well I guess you have to be more clear about what do you mean with "one String object is less than another"

OpenStudy (anonymous):

I also notice that you didn't mention a language and I just assumed java for some reason. However comparing the lengths is similar in other languages and there are similar strings 'compare' functions as well.

OpenStudy (queelius):

It depends on how the less-than operator is defined -- there is no one "right way." However, typically (or by default), for strings, if A < B, then A comes before B in lexicographic order.

OpenStudy (anonymous):

|dw:1426192482204:dw|

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Breathless: Spooky witch but cute
1 hour ago 1 Reply 0 Medals
Arriyanalol: help
1 hour ago 7 Replies 2 Medals
Arriyanalol: @tinydinoUwU stop trying to find a argument u blad lil boy
20 hours ago 5 Replies 3 Medals
Jaded012023: Please tell me what you all think of this song
1 hour ago 6 Replies 1 Medal
Arriyanalol: bro how
1 hour ago 2 Replies 3 Medals
Arriyanalol: cant wait for the new bluey movie in 2027
20 hours ago 12 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!