wood burning stoves*
The moose likes Beginning Java and the fly likes Understanding Escape Characters, �bug� Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Understanding Escape Characters, �bug�" Watch "Understanding Escape Characters, �bug�" New topic
Author

Understanding Escape Characters, �bug�

Mark Lopez
Greenhorn

Joined: Aug 30, 2005
Posts: 18
Why this happen when \t is between (without space) M and L (M\tL)?


[ January 29, 2006: Message edited by: Mark Lopez ]
Mark Lopez
Greenhorn

Joined: Aug 30, 2005
Posts: 18

[ January 29, 2006: Message edited by: Mark Lopez ]
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Are you asking why there is only a small space between the M and the L but there is a big space between the L and the F? This is because the tab character ('\t') has several interpretations. In this case it looks like your console is using what are called "tab stops". This means that the tab character fills in white space until it reaches a tab stop. It looks like the tab stops are set every eight characters. So if you have 7 characters so far and then use a tab character, it will only insert one character to get to the total of 8 characters since the last tab stop. On the other hand, if you have 5 characters so far, the \t will add 3 spaces to get to the total of 8.

Layne


Java API Documentation
The Java Tutorial
Mark Lopez
Greenhorn

Joined: Aug 30, 2005
Posts: 18
Layne Lund

Yes, it seems to be the cause. The tab stops. The �tab� counts the space or character used before when �stop�. I take this in account next I have a problem. I used to believe that Java was over my OS. But it�s very portable.


Thank You,
[ January 29, 2006: Message edited by: Mark Lopez ]
 
Don't get me started about those stupid light bulbs.
 
subject: Understanding Escape Characters, �bug�
 
Similar Threads
Displaying ArrayList data in a JTable
problem with a select query. Help!
Formatting date as MMM for japnese locale
help me to solve this assignments..
extracting image binary data from file