I am practicing for interviews and I am given a question to create the String method indexOf without the use of string methods. My first thought was to process the String into a char[] but I am not sure how to do so without the use of .toCharArray()
If anyone has ever had this interview question asked to them I would love your input.
Stringat all - i.e.int indexOf(char[] str, char[] find)or similar. (Which is still not 'sensible', or course.)charAt()method.StringimplementsCharSequence. So you could write the method entirely against the abstractionCharSequence. Would that count as not 'using' methods fromString?