看板 java 關於我們 聯絡資訊
※ 引述《alenwu (Allen)》之銘言: : → slalala:要不要先判斷那是什麼? EX:\n? 05/19 23:37 : → alenwu:那是方塊不是任何字串,所以很頭痛 05/19 23:40 : 推 slalala:我會這麼說是因為SURVEY過 我沒說那是字串 但它絕對是字元 05/20 00:45 : 推 MonyemLi:改換行設定 unix->windows,我開過幾次這種的 05/20 02:03 在這點上我同意slalala的看法。 他一定是一個char或什麼, 你需要做的就是對檔案一個字一個字讀。 基本上BufferedReader 的read(), 應該可以有效幫你觀察出他是什麼char。 char不是只有標點符號那些「可見」的符號、字母、文字, ascii table裡面還規範了一些「具功能性」的字元, 像\r、\n之類的,這些由於他的確存在,而txt editor不曉得該怎麼解讀, 有時候就會以問號或者方塊的方式呈現,但是不代表他本來的意義就是方塊。 -- I am a person, and I am always thinking . Thinking in love , Thinking in life , Thinking in why , Thinking in worth. I can't believe any of what , I am just thinking then thinking , but worst of all , most of mine is thinking not actioning... -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.134.27.68