Suppose, I have a string vector, table
of say 32000 elements.
I want to use an if
loop to check whether the vector has (even a substring of the) string.
Suppose, my first three elements of table
are,
table[0]="starved monster"
table[1]="rabid mosquito"
table[2]="drunk ghost"
// ...
I want to iterate over this entire vector to check whether it has a substring, s="gho"
;
Since here, it does, I want to implement a code that says:
Yes the substring is there and it is at index=2.