String s1 = "Project";
String s2 = "Sunject";
I want to compare the two above string by their alphabetic order (which in this case “Project” then “Sunject” as “P” comes before “S”).
Does anyone know how to do that in Java?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
String.compareTomight or might not be what you need.Take a look at this link if you need localized ordering of strings.