Answer to Question #68166 in Java | JSP | JSF for Joe

Question #68166
Write a Java program that meets the following requirements:-
Using up to and including Chapter 20 concepts.
Found at the end of chapter 20, #20.1 Display words in ascending alphabetical order, but with these
changes. Make it a GUI program using JavaFX. Display the input and include a button the user can click
which will then display the text in alphabetical order.
1
Expert's answer
2017-05-25T12:08:11-0400
Due to absence of book mentioned, we provide only the part of answer:

public static List<String> getWordsInASC(String text){

List<String> list = new ArrayList<>();

Pattern p = Pattern.compile("[A-Za- z]+");

Matcher m = p.matcher(text.toLowerCase());

while (m.find()){

list.add(m.group());

}

return list.stream().sorted().collect(Collectors.toList());

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS