Searching strings - substring's
Building a search function, I want to build a function that checks if in a string, contains an substring that the use define, hmm, I know that have the strstr(), but I want to build a simple one, by myself.
I want to understand, how's exactly it works?
Example, I have the string "Isaac" and want to check the substring "aa" for existance.
Now, I should separete the string in all possible 2 (the size of the substring we want to search) substrings? like: is, sa, aa, ac? and than check if they are what we're searching? isn't this so many job to the pc?
Hmm, I'm in the right way?
:confused: