substring(int beginIndex, int endIndex)
is a function in Groovy that pads the String
with the spaces added to the right.
String substring(int beginIndex, int endIndex)
The function takes in two parameters:
beginIndex
: This is the beginning index (inclusive).
endIndex
: This is the ending index (exclusive).
The function returns the specified substring.
class Example {static void main(String[] args) {String result = "Edpresso";println(result.substring(1,5));}
dpre