Java String contains

The java string contains() method searches the sequence of characters in this string. It returns true if sequence of char values are found in this string otherwise returns false.


The signature or syntax of string trim method is given below:

public boolean contains(CharSequence sequence)


sequence : specifies the sequence of characters to be searched.


true if sequence of char value exists, otherwise false.


NullPointerException : if sequence is null.

Java String contains() method example

Flash soon

© Sapster 2017