**************************************************************
COMPLETE SOURCE CODE FOR : CheckWordInString.java
**************************************************************
import java.util.StringTokenizer;
public class CheckWordInString
{
public static void main(String[]args)
{
String a="Hello World !";
/*
*Word(hello) that we want
*to check if exist
*or not in String a
*/
String b="hello";
/*
*Get all word that
*separate by white space
*in String a
*/
StringTokenizer st
=new StringTokenizer(a);
while(st.hasMoreTokens())
{
String temp=st.nextToken();
/*
*Compare with
*ignore case
*/
if(temp.equalsIgnoreCase(b))
{
System.out.println
("b exist in a");
break;
}
}
}
}
**************************************************************
JUST COMPILE AND EXECUTE IT
**************************************************************