• • 10. When reading data from a text file, it is common to see numbers such as 12,345, $20, or 195*. Write a method tha
Posted: Fri May 20, 2022 1:08 pm
• • 10. When reading data from a text file, it is common to see numbers such as 12,345, $20, or 195*. Write a method that cleans a string containing digits by removing any characters that are not a digit or a - sign. Then convert to an integer and return the result. /** Numbers.java 1 public class Numbers 2 { 3 4 Cleans a string containing an integer and converts it. 5 @param number a string containing an integer and possibly extra characters 6 @return the value of the number inside the string 7 */ 8 public static int clean(String number) 9 { 10 11 } 12 }