Hello! Recently received a task: Write the implementation of the function: Int pos (String search, String where); Where: search - the desired string, where - where we search. The function returns the position of the search string in the string where or -1 if the occurrence was not found. The string is considered an array Char (indexing from 0). Char can be compared with each other. The string has only the length () method, there are no other methods.
I ask for help from more experienced. I decided first with indexOf (), but of course the answer was not counted. I also thought that it was necessary to compare the length of the search string with the lengths of the elements of the where array, but how to put it into the syntax java does not occur.
It is not necessary to write all the code, you can make an analogy, send by reference to similar tasks.
Thank!