Skip to main content
781 votes
4 answers
1.6m views

How do I strip all spaces out of a string in PHP? [duplicate]

How can I strip / remove all spaces of a string in PHP? I have a string like $string = "this is my string"; The output should be "thisismystring" How can I do that?
streetparade's user avatar
  • 32.8k
502 votes
22 answers
1.2m views

How to run an EXE file in PowerShell with parameters with spaces and quotes

How do you run the following command in PowerShell? C:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe -verb:sync -source:dbfullsql="Data Source=mysource;Integrated Security=false;User ID=sa;...
Vans's user avatar
  • 5,029
469 votes
10 answers
696k views

Echo tab characters in bash script

How do I echo one or more tab characters using a bash script? When I run this code res=' 'x # res = "\t\tx" echo '['$res']' # expect [\t\tx] I get this res=[ x] # that is [<space>x]
kalyanji's user avatar
  • 4,878
309 votes
19 answers
197k views

How can I convert tabs to spaces in every file of a directory?

How can I convert tabs to spaces in every file of a directory (possibly recursively)? Also, is there a way of setting the number of spaces per tab?
cnd's user avatar
  • 33.6k
279 votes
13 answers
397k views

Visual Studio Code - Convert spaces to tabs

I have both TypeScript and HTML files in my project, in both files tabs are converted to spaces. I want to turn the auto-conversion off and make sure that my project has only tabs. Edit: With this ...
Matan Yadaev's user avatar
  • 3,308
242 votes
14 answers
462k views

How to strip all whitespace from string

How do I strip all the spaces in a python string? For example, I want a string like strip my spaces to be turned into stripmyspaces, but I cannot seem to accomplish that with strip(): >>> '...
wrongusername's user avatar
234 votes
10 answers
189k views

How can I convert leading spaces to tabs in Vim or Linux?

I've looked over several questions on Stack Overflow for how to convert spaces to tabs without finding what I need. There seem to be more questions about how to convert tabs to spaces, but I'm trying ...
cwd's user avatar
  • 54.6k
227 votes
11 answers
219k views

Sublime Text 3, convert spaces to tabs

I know there are a lot of posts about this, but I couldn´t get it to work. I use tabs for coding. Is there a way, to convert always spaces to tabs? I.e. on open and on Save files? Anyone got an idea? ...
chris's user avatar
  • 4,867
224 votes
20 answers
1.6m views

How to insert spaces/tabs in text using HTML/CSS

Possible ways: <pre> ... </pre> or style="white-space:pre" Anything else?
Yeseanul's user avatar
  • 2,867
222 votes
8 answers
789k views

std::cin input with spaces?

#include <string> std::string input; std::cin >> input; The user wants to enter "Hello World". But cin fails at the space between the two words. How can I make cin take in the whole of ...
dukevin's user avatar
  • 23.1k
184 votes
5 answers
147k views

Show SOME invisible/whitespace characters in Eclipse

A long while back I transitioned to doing all my web application development in Eclipse from BBEdit. But I miss one little feature from BBEdit. I used to be able to show invisible characters like tabs ...
bryan kennedy's user avatar
154 votes
4 answers
185k views

How can I add white space before an element's content using CSS?

None of the following code works: p:before { content: " "; } p:before { content: "&nbsp;"; } How do I add white space before an element's content? Note: I need to color the ...
Hugolpz's user avatar
  • 18.2k
137 votes
11 answers
74k views

Can you make valid Makefiles without tab characters?

target: dependencies command1 command2 On my system (Mac OS X), make seems to require that that Makefiles have a tab character preceding the the content of each command line, or it throws a ...
xyz's user avatar
  • 27.8k
135 votes
6 answers
266k views

How do I convert a list into a string with spaces in Python?

How can I convert a list into a space-separated string in Python? For example, I want to convert this list: my_list = ["how", "are", "you"] into the string "how are ...
user1653402's user avatar
  • 1,453
128 votes
11 answers
107k views

Linux - Replacing spaces in the file names

I have a number of files in a folder, and I want to replace every space character in all file names with underscores. How can I achieve this?
Mithun Sreedharan's user avatar

15 30 50 per page
1
2 3 4 5
201