在java中如何讀取txt文件時?
public class ReadText { public static void main(String[] args) { String line = ""; try { BufferedReader br = new BufferedReader(new FileReader("D:\\test.txt")); while((line = br.readLine()) != null){ br.skip(line.length());//在此次加入你要跳過行的條件 System.out.println(line); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } }}test.txt的內容是12345執行結果是135