Forum Discussion

marck's avatar
marck
Occasional Contributor
11 years ago
Solved

Can't read the tab spaces from a file.

I'm trying to read from a log file stored on my PC. The log contains tab spaces and I want to read those as well. I use the ReadLine() method to read the line that I want, but it doesn't read the tab...
  • HKosova's avatar
    HKosova
    11 years ago

    The file is read correctly. What you see is the log viewer stripping the whitespace - this is how it works. But if you check the individual characters in a string, you'll see the tabs (code 9) are there:

     

    s = F.ReadLine();
    Log.Message(s);

    for (var i = 0; i < s.length; i++)
    Log.Message(s.charAt(i) + " (code " + s.charCodeAt(i) + ")");