I downloaded some code from the Internet, and the four-space indentation is bugging the crap out of me. I tried to do a find and replace for "<4 spaces>" and replace it with "\t", but that just replaced all sets of spaces with the string "\t". How would I put a tab in the "replace" box?
Ctrl + H > File Search tab.
Eclipse - Tab to spaces And eclipse uses tabs for spaces by default. Tabs are always dependent on the environment and use 4 spaces in windows. If you use source code written with tab spaces, code is consistent across different environments.
You can simply use this regular expression to replace any type of escapes( including tabs, newlines, spaces etc.) within a String with the desired one: lineOfText. replaceAll("\\s", " ");
Text Editors
from tree menu.Insert spaces for tabs
.After that, run Format
menu from context menu and save the file:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With