VOOZH about

URL: https://www.geeksforgeeks.org/java/pattern-tostring-method-in-java-with-examples/

⇱ Pattern toString() Method in Java with Examples - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Pattern toString() Method in Java with Examples

Last Updated : 6 Mar, 2019
toString() method of a Pattern class used to return the string representation of this pattern. This return the regular expression from which this pattern was compiled. Syntax:
public String toString()
Parameters: This method accepts nothing as parameter. Return value: This method returns a string representation of this pattern. Below programs illustrate the toString() method: Program 1:
Output:
Pattern:geeks
Program 2:
Comment