Saturday, August 23, 2008
Java String Length Example
import java.lang.*;
import java.io.*;
public class Strlen{
public static void main(String[] args) throws IOException{
System.out.println("Count the Lenght of String");
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter String:");
String str = bf.readLine();
int len = str.length();
System.out.println("Length of Text : " + len);
}
}
Subscribe to:
Posts (Atom)