String Based Task 2
1. Write a program that accepts an array by 10 names and
display all names that end with “h”.
2. Write a program that accepts an array by 10 names and
display all names that contain “he”.
3. Write a program in java to extract a substring from a given
string.
Test Data :
Input the string : this is test string
Input the position to start extraction :9
Input the length of substring :4
Expected Output :
The substring retrieve from the string is : " test "
4. Write a program in java to print individual characters of string
in reverse order.
Test Data :
Input the string : welcome
Expected Output :
The characters of the string in reverse are :
emoclew
5. Write a program in java to count the total number of words in
a string.
Test Data :
Input the string : welcome to bhopal
Expected Output :
Total number of words in the string is : 3
By Ram Lovewanshi