How to sort a strings array in java?
-
Strings[] ids = {"123A", "122A", "110A", and "410A"} and i need to sort this array from lowest to highest. Any ideas how i could approach this? ...show more
-
Answer:
Use the string compareTo and compareToIgnoreCase functions when you are making the comparisons: String str1 = "abc"; String str2 = "def"; if( str1.compareTo( str2 ) < 0 ) ... System.out.println( "str1 comes before str2" ); http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#compareTo(java.lang.String)
3YR76ARZ3KBVM7LK5ETFK7VYCE at Yahoo! Answers Visit the source
Related Q & A:
- How to sort a particular page in gridview?Best solution by dotnetfox.com
- How To Sort a GridView Column When a Header Is Clicked?Best solution by Stack Overflow
- How to convert a char array into an int in C++?Best solution by Stack Overflow
- how to create a new syntax in java?Best solution by Stack Overflow
- How to insert a date variable in java?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.