• Skip to main content
  • Skip to primary sidebar
  • Skip to secondary sidebar
  • Skip to footer
  • Java Tutorial
  • Java Posts
  • Node.js
  • Spring Core
  • Algorithms
  • Docker
  • Blogging
  • Misc
Tech Stack Journal

Tech Stack Journal

How Many Spaces in a Tab?

February 20, 2021 by Admin Leave a Comment

I always wonder, what if there was no tab key on the keyboard, how the world would have been? I pity on those people who don’t know about this wonder key and still use spacebar to beautify their work. So, now you recognized the power and wondering how many spaces are there in a tab? Let’s go into details.

First of all, a tab is a character just like any other characters on your keyboard. However, its behavior varies based on the application you are working on.

A standard tab character takes width of 8 characters when you print it on Command Prompt, Windows Notepad. However, when you hit this key on Eclipse, Notepad++, it takes width of 4 character long.

In most of the programming languages, we use slash-t written as “\t ” to print a tab character on the console. It is one among many of the escape sequences that are available.

In some applications, a Tab key performs an action, for example, in Excel if you press tab key, it doesn’t print anything on the sheet, however it jumps from one cell to another cell. If you press a tab key on web form also, it will jump from one text box to another text box.

The beauty of tab character is, you can write a table in a notepad separating the columns using the tab character, then copy these contents and paste it into an excel file. Excel automatically recognizes the tab character and puts all those columns of the table into individual excel columns.

Filed Under: Misc

Previous Post: « [Solved] error: char cannot be dereferenced
Next Post: How to Convert an Array to List in Java? »

Primary Sidebar

More to See

Factorial Program in JavaScript using While Loop

March 24, 2021 By Admin

Flowchart of Nested For Loop

March 22, 2021 By Admin

Secondary Sidebar

Categories

  • Algorithms
  • Blogging
  • Docker
  • Java
  • JavaScript
  • Misc
  • Node.js
  • Programming Concepts
  • Spring Core
  • Windows

Archives

  • April 2021 (1)
  • March 2021 (7)
  • February 2021 (6)
  • January 2021 (1)
  • December 2020 (1)
  • September 2020 (2)
  • August 2020 (5)
  • July 2020 (4)
  • June 2020 (1)
  • May 2020 (4)
  • April 2020 (22)
  • November 2019 (3)
  • September 2019 (2)
  • August 2019 (6)

Footer

  • Privacy Policy
  • Cookie Policy
  • Contact Us
  • About Us

Recent

  • How to Fix – The system cannot find the file C:\ProgramData\Oracle\Java\javapath\java.exe
  • Factorial Program in JavaScript using While Loop
  • Flowchart of Nested For Loop
  • Difference Between Constructor Overloading and Method Overloading in Java
  • Constructor Calling in Java

Search

Copyright © 2021 · Tech Stack Journal · Log in