Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Find character in word in list of words and remove from original list and add to new list (java) I have a list of words

Find character in word in list of words and remove from original list and add to new list (java)

I have a list of words that I've turned into a string array. I ask the user to enter a character, and my code must find whether that character is in one of the words in the list of words and add that word to a new list and removed from the original list. How do I do that? Here's

String[] temps2 = newList.toArray(new String[0]); //turns list to string array. System.out.println(" pick a letter."); letter_1 = input.next()charAt(0); for (String b : temps2){ for(char ch : b.toCharArray()){ if letter_1==ch){ temps2.remove(b);//don't think you can do that. 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MongoDB Applied Design Patterns Practical Use Cases With The Leading NoSQL Database

Authors: Rick Copeland

1st Edition

1449340040, 978-1449340049

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago