Javatpoint Logo
Javatpoint Logo

Java Matcher quoteReplacement() Method

The quoteReplacement() Method of Matcher class returns a literal replacement String for the specified String. This method can be used with the matcher object and perform replacement operation in the appendReplacement method of matcher class.

Syntax

Parameter

s - The string to be literalized

Returns

A literal string replacement

Since

1.5

Example 1

Test it Now

Output:

java is platform :) 

Example 2

Test it Now

Output:

Exception: Illegal group reference: group index is missing
java$ is secure .java$ is platform
Next TopicJava Matcher




Help Others, Please Share

facebook twitter pinterest