Implement a method that matches an entire string with star wildcard pattern, e.g. returns true for ("*ogle", "Google"), but false for ("fragile*", "agile") - without using regular expression language support.
Sigiloso
Following code should resolve the problem: Consider that there can be only one '*' symbol in first pattern string boolean match (String a, String b) { boolean match = true; if(!a.contains("*")) { return a.equals(b); } else { String prefix = a.substring(0, a.indexOf('*')); String suffix = a.substring(a.indexOf('*')+1); if (StringUtils.isNotEmpty(prefix) && !b.startsWith(prefix)) { match = false; } if (StringUtils.isNotEmpty(suffix) && !b.endsWith(suffix)) { match = false; } } return match; } none of used class String methods use regular expression language support