String Methods
View as PDFThe String class has boolean methods startsWith(String prefix) and endsWith(String suffix). startsWith tests whether a string starts with a given substring; endsWith tests whether a string ends with a given substring. Pretending that these methods do not exist, write them using other string methods (but no iterations or recursion).
In this problem you will be given a base string, , and 10 test strings,
. Both strings will be composed solely of lower case letters.
Input Specifications
The first line will contain the string .
The next 10 lines will each contain a string, .
Output Specifications
Output yes if starts or ends with
.
Output no otherwise.
Sample Input
recursion
rec
recur
ion
on
n
ecur
io
sio
random
a
Sample Output
yes
yes
yes
yes
yes
no
no
no
no
no
Comments