Javatpoint Logo
Javatpoint Logo

Java Matcher hitEnd() Method

Java 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:

Parameter

NA

Returns

true if the end of input was hit in the last match; false otherwise

Since

1.5

Example 1

Test it Now

Output:

find(): false
hitEnd(): true

Example 2

Test it Now

Output:

find() : true
hitEnd(): true
number of match by find() method : 2

Example 3

Test it Now

Output:

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




Help Others, Please Share

facebook twitter pinterest