Results 1 to 4 of 4
- 10-26-2013, 08:28 PM #1
Member
- Join Date
- Oct 2013
- Posts
- 2
- Rep Power
- 0
Sorting by numbers of words in each sentence that is in ArrayList index.
Hello! I am a beginner!I have a task to sort sentences by its word quantity, that is in Arraylist.For example,here is the code of my Array example:
List<String> numberOfWords=new ArrayList<>();
numberOfWords.add("Happy coding!"); //2 words or 3 with(!),I don't know
numberOfWords.add("He plays football in the playground everyday"); //7
numberOfWords.add("She is cooking an omellette"); //5
numberOfWords.add("I am coding in Java"); //5
numberOfWords.add("I want to code very well"); //6
// And the result must be like this: So, please could anyone give me some advice on how to come to this outcome??? Thanks!!!
Happy coding! //2 words
I am coding in Java //5 words
She is cooking an omellette //5words
I want to code very well //6 words
He plays football in the playground everyday //7words
- 10-26-2013, 08:33 PM #2
Re: Sorting by numbers of words in each sentence that is in ArrayList index.
If you don't understand my response, don't ignore it, ask a question.
- 10-26-2013, 09:08 PM #3
Member
- Join Date
- Oct 2013
- Posts
- 2
- Rep Power
- 0
Re: Sorting by numbers of words in each sentence that is in ArrayList index.
Norm ,What does this mean ?
- 10-26-2013, 09:21 PM #4
Similar Threads
-
how to reverse the order of words in a sentence?
By dksellou in forum New To JavaReplies: 6Last Post: 09-05-2014, 08:04 PM -
Matching words in a sentence in java to follow instructions
By CodeX Pro in forum New To JavaReplies: 8Last Post: 08-29-2013, 04:45 PM -
Help with finding how many words there are in a sentence.
By Happypanda in forum New To JavaReplies: 3Last Post: 07-09-2012, 12:08 AM -
index enforcing query terms to appear within the same sentence
By miwieg in forum LuceneReplies: 0Last Post: 03-03-2011, 05:58 PM -
and after SEARCH for a any string like words or sentence or urls, for how many times
By lse123 in forum Advanced JavaReplies: 0Last Post: 02-25-2010, 01:51 PM
Bookmarks