Find a substring in a given string

How to find a substring in a given string in Apache Hadoop/Spark? Can someone please help me out with this? I tried comparing by normal method: if(String1==String2) { coding } but It is not responding.

This method will return a boolean value whether the String2 is equal to String2 or String2 is SubString of String1 and for this method import:

“org.apache.commons.lang.StringUtils” class.

Boolean check = StringUtils.containsIgnoreCase(“String1”,“String2”);

so you can use:

if(StringUtils.containsIgnoreCase(“String1”,“String2”))
{
coding;
}