- 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 1 (90.51 KiB) Viewed 45 times
• • 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
-
- Site Admin
- Posts: 899603
- 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 }