This is nice but i cant used this.
I must find it be loop for.
You did ask for easy way. That is string::find()
Note that there are string::substr() and operator== that tells whether two strings are identical. Alas, you must use a loop.
You must use the think instead. You have to implement equivalent of string::find() yourself.
Nested loops. The outer iterates over the string positions that a match could start from. The inner tests whether there is a match.
Last edited on