Question: Use methods from chapter 6 to write a program with two functions. The first function should take as argument a string representing some message that
Use methods from chapter 6 to write a program with two functions. The first function should take as argument a string representing some message that contains both words and numbers. the function should redact out all numbers. That is every number needs to be replaced with the string "xxxx". The function should return the redacted string. The second Kotlin function should do similar processing as the first function, but this time each single digit must be replaced with one "x". The difference is that if the text contains a two digit number that will be replaced with "xx" but if the number in the text has,say, 5 digits it will be replaced by "xxxxx"
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
