Java examples for Language Basics:String
String Contains
public class Main { public static void main(String args[]){ String str1 = "Hello World"; String str2 = "Hello"; // w ww . ja v a 2 s.c o m boolean blnFound = str1.contains(str2); System.out.println("String contains another string? : " + blnFound); } }