File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 40052
    
  28
And what was the answer?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: \t size in java