This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one 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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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: 38466
    
  23
And what was the answer?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: \t size in java