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 is an example of the usage of strings in Groovy −
class Example { static void main(String[] args) { String a = "Hello"; println(a.length()); } }
When we run the above program, we will get the following result −
5
Previous Page:-Click Here
Pingback: Groovy - Strings - Adglob Infosystem Pvt Ltd
Great, thanks for sharing this article. Really Great.