Groovy – getAt()
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…
Groovy
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…
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 +…