We can use the method , charAt() , to extract the word in the string.

for example:

try

{

BufferedReader in = new BufferedReader(new FileReader("test.txt"));

 

String str;

str = in.readLine();

for(int i=0 ; i<str.length() ; i++)

{

System.out.println( charAt(i) );

}


}

catch (IOException e)

{

System.out.println(e);

}

文章標籤
全站熱搜
創作者介紹
創作者 JerryCheng 的頭像
JerryCheng

KwCheng's blog

JerryCheng 發表在 痞客邦 留言(0) 人氣(1,509)