Groovy – padRight()
Pad the String with the spaces appended to the right. This method has 2 different variants. String padRight(Number numberOfCharacters) − Pad the String with the spaces appended to the right. Syntax…
Pad the String with the spaces appended to the right. This method has 2 different variants. String padRight(Number numberOfCharacters) − Pad the String with the spaces appended to the right. Syntax…
Pad the String with the spaces appended to the left.This method has 2 different variants. String padLeft(Number numberOfCharacters) − Pad the String with the spaces appended to the left. Syntax String…
This method is called by the ++ operator for the class String. It increments the last character in the given String. Syntax String next() Parameters None Return Value The new…
Removes the value part of the String. Syntax String minus(Object value) Parameters Value – the string object which needs to be removed Return Value The new string minus the value…
It outputs whether a String matches the given regular expression. Syntax Boolean matches(String regex) Parameters Regex − the expression for comparison. Return Value This method returns true if, and only if,…
Returns the index within this String of the first occurrence of the specified substring. This method has 4 different variants. public int indexOf(int ch) − Returns the index within this string…
In this section, we will discuss, get method in Groovy. Syntax String getAt(int index) Parameters Index – The position of the string to return Return Value String value at the…
Compares this String to another String, ignoring case considerations. Syntax Boolean equalsIgnoreCase(String str) Parameters Str - the String to compare this String against Return Value This method returns true if…
Tests whether this string ends with the specified suffix. Syntax Boolean endsWith(String suffix) Parameters Suffix – The suffix to search for Return Value This method returns true if the character…
Processes each regex group (see next section) matched substring of the given String. Syntax void eachMatch(String regex, Closure clos) Parameters Regex – The string expression to search forClosure – optional…