Groovy – previous()

  • Post author:
  • Post category:Groovy
  • Post comments:1 Comment
previous() method i

In this section, we will discuss the previous() method in groovy.

Syntax

String previous()

Parameters

None

Return Value

This method returns the resulting String.

Example

Following is an example of the usage of this method −

class Example { 
   static void main(String[] args) {
      String a = "Hello"; 
      println(a.previous());
   }
}

When we run the above program, we will get the following result −

Helln

Previous Page:-Click Here

This Post Has One Comment

Leave a Reply