Results 1 to 3 of 3
- 12-04-2011, 07:05 AM #1
Member
- Join Date
- Dec 2011
- Posts
- 7
- Rep Power
- 0
How can I sort an array of strings that contain numbers, letters and dashes?
I am a student and cannot use one of java's built in sort methods. The strings are in the format LDD-DDDDD, where L can be a letter B,M or P.
D represents a digit. i.e. B09-00002. Our teacher has specified that we must use the "selection sort" method for sorting integers and modify it to work in this situation. There are several other parts to the program that I have already done, but I can't think my way through this one. Please help me, I have to take my final in 2 days (well one now), and I haven't been able to study because I am so busy trying to finish this last assignment. Please try to go in depth, as I really need to understand how to do this.
- 12-04-2011, 07:25 AM #2
Member
- Join Date
- Nov 2011
- Posts
- 10
- Rep Power
- 0
Re: How can I sort an array of strings that contain numbers, letters and dashes?
do you mean by using substring and indexof methods and such?
- 12-04-2011, 08:21 AM #3
Member
- Join Date
- Dec 2011
- Posts
- 7
- Rep Power
- 0
Re: How can I sort an array of strings that contain numbers, letters and dashes?
Well our teacher says we can only use methods that we have been taught in class and I dunno if we have learned either of those. What would be the specific keywords for those? I think we have to compare each string by breaking it down into characters and comparing them but I'm not sure.
Similar Threads
-
changing letters in strings
By dienesh77 in forum New To JavaReplies: 8Last Post: 02-17-2011, 01:56 PM -
converting letters to numbers
By fenhoff in forum New To JavaReplies: 2Last Post: 01-24-2010, 04:45 AM -
Using Merge Sort to sort an ArrayList of Strings
By coldfire in forum New To JavaReplies: 3Last Post: 03-13-2009, 01:03 AM -
text Strings to produce letters
By dc2acgsr99 in forum New To JavaReplies: 7Last Post: 01-29-2008, 08:08 PM -
validating a string for numbers and letters?
By lockmac in forum New To JavaReplies: 1Last Post: 08-09-2007, 09:17 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks