1. Engineering
  2. Computer Science
  3. problem 2 30 points and pattern and determines if the...

Question: problem 2 30 points and pattern and determines if the...

Question details

Problem 2 (30 points) and pattern, and determines if the pattern exists in the text or not. Your method should return true or false. You need to implement the method yourself and you cannot call the existing methods (like substring, regular expressions,...) written for String in Java. The goal is to go over the characters, make comparisons and solve the problem yourself. public class StringDemo\ public boolean containsPattern(String text, String pattern)\ I write your code here public static void main(String[] args) Il a simple runner method Stringt-this is the text String p tex; String outputText = (containsPattern(t, p))?Yes, The pattern is in the text.No, The pattern is NOT int the text System.out.println(outputText);
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution