getReversestring(s: String):String-return the reverse string of the string s
countDigitsInString(s:String):int - return the number of the digits in the string s
Hints: you can use the isDigit() method of Character class to check whether a character is a digit or not and charAt() method to get a character in the string
The program output might look something like this:
1.Test getReverseString()
1.Test getReverseString()
2.Test countDigitsInString()
2.Test countDigitsInString()
Enter TC(1 or 2):1
Enter TC(1 or 2):2
Enter the string:hello
Enter the string:abc 123 hello
OUTPUT:olleh
OUTPUT:3
Zoom
+ 100%
Close