How to find a word from a sentence with stringfind?

 

Hi 

I have an indicator which reads from a csv file. Now after fetching the data it stored in Description which is a string data type.

On Description data are stored in following manners: 

"Apple Fruit"

"Potato Vegetables" 

Using stringfind I want to fetch only Fruit.

I am doing this:

int comp = StringFind(Description,"Fruit",0);

 But it returns comp = -1 all the time. Even if there is a data similar to fruit available on the csv file.

 Please help how to do this.

Thank you in advance. 

 
Provide the full code to get help!
 

You can be shure that StringFind works correct.

Maybe there is a "fruit" in Description and no "Fruit" ?

You have to check each line of the csv-file seperately.

 
Do a small test and Print Description before using StringFind to make sure that "Fruit" is in the string variable
 

Thank you everybody for such a quick reply. Actually I figure, its happening because of the space. If I search for Apple then its not problem. But if I search for Fruit, then it creates problem. In case of stringfind I need to give start point, I use 0 as start point. But as soon it hit space, I guess it stopped there. 

So I need to find where the space is located. So that In stringfind I can search after the space.

Any idea?

Thank you again. 

 

A space is no problem for StringFind!

Check what's in Description.

 
eddie:

A space is no problem for StringFind!

Check what's in Description.

Yes checked it out. 
I am extremely sorry, I made a silly mistake, space is not a problem. 

Search type spelling was wrong.

I Solved it now.. Thank you again..

Have a nice day... everybody... 

Reason: