String Contains a Specific Word?

Hello and thank you for such a great product! :)

I'm trying find a quick and easy way to determine if a string contains a specific word. Is there? :?

What I'd like to do is see if the data with a variable contains a specific word and if it does, I don't want to print it to the output file. If it doesn't, then I want it to be printed.

Thanks for any suggestions.

Joey

String Contains a Specific Word?

Great Stuff! It's working perfectly!

I have very little programming knowledge, but a great sense of logic (IMO :lol:)

Thanks for the info!

Joey

String Contains a Specific Word?

Hi,

Yes, they can. I'm not familiar with your programming background, but if you'd like more information on Java you might try Sun's tutorial http//java.sun.com/docs/books/tutorial/index.html . Also bear in mind that, if you're more familiar with them, you can script in another language, such as VBScript or JavaScript.

Best,

Todd Wilson
[email protected]

String Contains a Specific Word?

Hey todd, thanks for the reply, I'll give that a shot. :D

Another ?

Can IF ELSE statements be nested?


IF
{
//
}
ELSE
{
IF
{
//
}
ELSE
{
//
}
}

String Contains a Specific Word?

Hi Joey,

It will depend on what language you're scripting in. If you're using the default, Interpreted Java, you would do that like this:

myStr = "This is my string.";

if( myStr.indexOf( "my" )!=-1 )
{
// Perform logic needed if the string is found.
}
else
{
// The string is not found.
}

Hopefully that helps. If not, feel free to post a reply.

Kind regards,

Todd Wilson
[email protected]