Ask your own question, for FREE!
Computer Science 11 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
Arriyanalol: i need help
2 days ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
3 days ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 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!