sTring LengTh iN jaVa

import java.io.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;


public class StringLength {
public static void main(String[] args) {
try{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter String value:");
String s=br.readLine();
System.out.println("string "+s);
int len=s.length();
System.out.println("length of the string is " +len);
}catch(Exception e){
System.out.println("");
}
}

}

Post a Comment

أحدث أقدم