I’m using this code to read a line of text from a file :
BufferedReader br = new BufferedReader(new FileReader("myFile.txt"));
String line = br.readLine();
If the line contains tabs : (\t) then this character is not read correctly. It just appears as an empty space. How can I determine if a tab character is contained in the line of text currently being read ?
My first reaction would be that this is the fault of whatever it is that is displaying the output. Try redirecting the output to a file and viewing it with a tool that you KNOW will show any TAB characters if they are there. (For example, the
odutility if you are using UNIX / Linux.) And check the input file too.