Matcher requireEnd() method in Java with Examples
The requireEnd() method of Matcher Class is used to check if any combination of anchors has caused the match to be bounded at the end. These anchors can be any anchor like a word anchor, for instance, or a lookahead. This method returns a boolean value stating the same.
public boolean requireEnd()
Parameters: This method takes no parameters.
Return Value: This method returns a boolean value stating whether if any combination of anchors has caused the match to be bounded at the end.
Below examples illustrate the Matcher.requireEnd() method:
Has any anchor bounded the search: true
Has any anchor bounded the search: false
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.