Java Matcher quoteReplacement() MethodThe 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. SyntaxParameters - The string to be literalized ReturnsA literal string replacement Since1.5 Example 1Test it NowOutput: java is platform :) Example 2Test it NowOutput: Exception: Illegal group reference: group index is missing java$ is secure .java$ is platform
Next TopicJava Matcher
|