Java: How to Check if a String Contains a Substring? Implement Your Own Method • Crunchify
I have two Strings: str1 and str2. How to check if str2 is contained within str1? You can definitely use Java’s own .contains() method. Here by this program we will implement contains() method. Let’s call it as findMe(String subString, String mainString) ...