Groovy – concat()
Concatenates the specified string to the end of this String. Syntax String concat(String str) Parameters str - the String that is concatenated to the end of this String. Return Value…
Concatenates the specified string to the end of this String. Syntax String concat(String str) Parameters str - the String that is concatenated to the end of this String. Return Value…
Compares two strings lexicographically, ignoring case differences. Syntax int compareToIgnoreCase(String str) Parameters Str – String value for comparison. Return Value This method returns a negative integer, zero, or a positive…
Returns a new String of length numberOfChars consisting of the recipient padded on the left and right with space characters. Syntax String center(Number numberOfChars) Parameters Number – Number of characters…
Syntax − The length of the string is determined by the length() method of the string. Parameters − No parameters. Return Value − An Integer showing the length of the string. Example Following…
Syntax The repetition of strings can be done by the simple ‘*’ operator. String*number Parameters The parameters will be A string as the left operand for the * operatorA number…
Syntax The concatenation of strings can be done by the simple ‘+’ operator. String+String Parameters − The parameters will be 2 strings as the left and right operand for the +…
A String literal is constructed in Groovy by enclosing the string text in quotations. Groovy offers a variety of ways to denote a String literal. Strings in Groovy can be…
The method is used to generate a random number between 0.0 and 1.0. The range is: 0.0 =< Math.random < 1.0. Different ranges can be achieved by using arithmetic. Syntax…
The method converts the argument value to radians. Syntax double toRadians(double d) Parameters d - A double data type. Return Value This method returns a double value. Example Following is…
The method converts the argument value to degrees. Syntax double toDegrees(double d) Parameters d - A double data type. Return Value This method returns a double value. Example Following is…