>>wanted solution
I want a million dollars too -- will you give it to me ??? Kindly deposit it into my paypal account.
Hint to the solution: use strstr() to find the substring, then subtract two pointers (return value of strstr() and the original pointer)
char str = "Hello World";
strstr( str, "World") - str + strlen("World");
The above will crash if "World" is not contained in str.