How do I compare strings to determine sequence? IE. if I have String a = "ABC"; and String b = "DEF"; I want to compare a to b and get a result which tells me which should come first.
Printable View
How do I compare strings to determine sequence? IE. if I have String a = "ABC"; and String b = "DEF"; I want to compare a to b and get a result which tells me which should come first.
use the following:
String a = "ABC", b = "DEF";
if (a.compare(b) < 0)
// a comes before b
else
// b comes before a
-------------------------------------------
weaver
icq# 64665116
Please rate this post.
http://weaver.x7.htmlplanet.com
THANK YOU :-)