String Length() Method

String Length() Method in Java with Example

 

What is String “Length” Method in Java?

This function is used to get the length of a Java String. The string length method returns the number of characters written in the String. This method returns the length of any string which is equal to the number of 16-bit Unicode characters in the string.

String “Length” Method Syntax:

Output:

Length of a String is: 24

Length of a String is: 8

top
X
Welcome to Our Website
Welcome to WPBot
wpChatIcon