String.contains() search for matching sequnce of string
The output is boolean ( true or false )

Here are some examples with output.
String my_str1="Welcome to plus2net";
System.out.println(my_str1.contains("2")); // true
System.out.println(my_str1.contains("net")); // true
System.out.println(my_str1.contains("plus2net")); // true
System.out.println(my_str1.contains("co")); // true
System.out.println(my_str1.contains("no")); // false
Searching for @ and . inside email address.
String my_str1="";
System.out.println(my_str1.contains("@")); // true
System.out.println(my_str1.contains(".")); // true
System.out.println(my_str1.contains(" ")); // false

All String functions

Post your comments , suggestion , error , requirements etc here

We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2021 All rights reserved worldwide Privacy Policy Disclaimer