我需要编写一个Java程序,当输入字母时,程序将从文件中读取并告诉我字母是该单词的前缀,中缀或后缀。我可以让程序找到并读取文件,但是我不知道在编写代码以查找前缀,中缀和后缀时从哪里开始,将不胜感激。
我希望它产生以下结果:
Substring problem.
Enter a substring: t
passersby - not found
absobloominglutely - infix
nana - not found
banana - not found
the - prefix
quick - not found
brown - not found
fox - not found
jumps - not found
over - not found
the - prefix
lazy - not found