Java 版 (精华区)
Q: 如何从控制台屏幕取得一串字符?
A: 方法1:
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Please Input the String:");
String inputExpr=br.readLine();
方法2:
InputStreamReader is= new InputStreamReader(System.in);
char[] charInput=new char[100];
System.out.println("Please Input the String:");
is.read(charInput);
String strSource=String.copyValueOf(charInput).trim();
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:4.770毫秒