Need a little help with a function!
I'v got a slight problem, Im sure its quite simple to solve - I just dont know how to order the syntax :/
I have to solve the following problem:
Design, code and test a function:
public static boolean contains(String str1,String str2)
// pre: str1 and str2 not null
// post: returns true if str2 is a substring of str1.
Hint: you will need a loop, and will need to know the length of str1 and str2.
For the solution I have so far worked out that I need to make use of the Pattern and Matcher methods to determin if str2 (in its entirity) exists anywhere within str1. Any assistance would be greatly apprechiated!