Question: Write a function select_strings(ArrayList strings) that returns an ArrayList of strings, containing every string in strings that has at least one numerical digit in its

Write a function select_strings(ArrayList strings) that returns an ArrayList of strings, containing every string in strings that has at least one numerical digit in its characters. A numerical digit is any of the characters in string 0123456789.

IMPORTANT: MAKE SURE THAT YOUR FUNCTION RETURNS AN ARRAY LIST, NOT AN ARRAY.

For example:

If a1 = [hello, 123, az7, az], then select_strings(a1) returns array list [123,

az7], because 123 and az7 are the only strings in a1 that contain a numerical digit.

If a1 = [{hello, az], then select_strings(a1) returns the empty array list [ ], because

none of the strings in a1 contains a numerical digit.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!