String Length
In this section, you will learn to get string length in java.
Code:
public class StringLength {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String str = "Welcome to java";
System.out.println("String Length: "+
str.length());
}
}
|
Output:
Download Example