• • 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
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
• • 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
• • 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 }
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!