Length of String in Java: Determining the length of String in Java is much easier than what you think of. It is as easy as it is just away from a simple method length() in the java.lang.String class.
st.length(): A method in the java.lang.String class that returns an int value which is length of the string.
-----------------------------------
Output
-----------------------------------
Length of string in Java is easy with length()
Length is 46
st.length(): A method in the java.lang.String class that returns an int value which is length of the string.
-----------------------------------
Output
-----------------------------------
Length of string in Java is easy with length()
Length is 46
No comments:
Post a Comment