Groovy – contains()
Checks if a range contains a specific value. Syntax boolean contains(Object obj) Parameters Obj − The value to check in the range list. Return Value Returns true if this Range contains…
Checks if a range contains a specific value. Syntax boolean contains(Object obj) Parameters Obj − The value to check in the range list. Return Value Returns true if this Range contains…
A ranges is a shorthand for specifying a sequence of values. A Range is denoted by the first and last values in the sequence, and Range can be inclusive or…
Converts all of the characters in this String to lower case. Syntax String toLowerCase() Parameters None Return Value The modified string in lower case. Following is an example of the…
Converts all of the characters in this String to upper case. Syntax String toUpperCase() Parameters None Return Value The modified string in upper case. Example Following is an example of…
Returns a new String that is a substrings of this String. This method has 2 different variants String substring(int beginIndex) − Pad the String with the spaces appended to the right.…
Splits this string around matches of the given regular expression. Syntax String[] split(String regex) Parameters regex - the delimiting regular expression. Return Value It returns the array of strings computed…
Creates a new String which is the reverse of this String. Syntax String reverse() Parameters None Return Value This method returns the resulting String. Following is an example of the…
Replaces all occurrences of a captured group by the result of closure on that text. Syntax void replaceAll(String regex, String replacement) Parameters regex − the regular expression to which this string…
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…
Appends a String Syntax String plus(Object value) Parameters Value − The object to append to the string Return Value This method returns the resulting String. Example Following is an example of…