This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes \t size in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "\t size in java" Watch "\t size in java" New topic
Author

\t size in java

Lucky J Verma
Ranch Hand

Joined: Apr 11, 2007
Posts: 278
I am little confused about how much spaces are included in \t in Java and its coming different if i print in on console.

I have a input string = "abc\n\tdef";
and printing on console -System.out.println (inputString) gives me something like
abc
def; (console printing shows bigger space for tabs)

I feed this inputString to a method ,that does some processing but wont harm tabs and returns the formatted string again.
That returned string has value
abc
def (less tabs space)
Lesser tabs space.I debugged the method if at a point tab is changing but no .
Method just reads everything line by line and appends \r\n inplace of \n.

I really dont understand what could be the reason for different tabs size on same platform and same language.

Thanks





Lucky J Verma
Ranch Hand

Joined: Apr 11, 2007
Posts: 278
Hey guys i got answer to my qn.Thanks.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37926
    
  22
And what was the answer?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: \t size in java
 
Similar Threads
Trying to print \n as it isin console
removing newline and tabs from a string
Where are the dates
comparison methods
Clear DOS screen in XP