Quote:Original post by baker
hey drevil question: i am trying to understand the function in my head. is this sort of right?
Yea, you got it.
Out of laziness I only incremented the current position by 1. Optimally you'd probably want to increment by the string length as raz0r did. If you didn't increment at all the loop would go on forever because it would keep finding the string in the same spot. Also don't forget the error checking for empty string, as raz0r also showed.
delta user: What are you talking about? Our solutions work fine on that, returning 1, unless I misunderstood your post.