string api methods examples

String contains() Java

Existence of a substring in the main string can be checked with String contains() method.

Output screen on String contains() Java Existence of a small string (substring) can be checked with indexOf() method also. For other String and StringBuffer API methods check String and StringBuffer.