in the string str. If no matching data is found, return 0
countWordBeginByString (s1:String, s2):int - count the number of words in string s1 that begin with string s2(not case sensitive). Suppose that s1 is a string of words separated by a space. If no matching data is found, return 0
Hints: You can refer to the methods: startsWith(), toLowerCase() of the String class and toLowerCase() of the Character class
The Main class is provided for you in binary form. You only test your program by running the binary file. There are several test cases for you, as follows:
7 of 7
Paper No: 1
1.Test countCharacters
1.Test countCharacters
2.Test countWordBeginByString
2.Test countWordBeginByString
Enter Test Case No.(1/2):1
Enter Test Case No.(1/2):2
Enter a string:HeLLo WOrld
Enter a string s1:hello world Hello world hello
Enter a character:o
Enter a string s2:hE
OUTPUT:
2
OUTPUT:
3
Zoom
+ 93%
Close