Java Matcher hitEnd() MethodJava Matcher hitEnd method of Java Matcher class is used to check the hits by the search engine. If the end of input was hit by the search engine in the last match operation performed by this matcher, then it returns true. Syntax:ParameterNA Returnstrue if the end of input was hit in the last match; false otherwise Since1.5 Example 1Test it NowOutput: find(): false hitEnd(): true Example 2Test it NowOutput: find() : true hitEnd(): true number of match by find() method : 2 Example 3Test it NowOutput: First Capturing Group, (a*b) Match String end(): 7 First Capturing Group, (a*b) Match String end(): 14 First Capturing Group, (a*b) Match String end(): 20 hitEnd(): true
Next TopicJava Matcher class
|