3,001
questions
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?
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;...
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]
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?
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 ...
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():
>>> '...
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 ...
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?
...
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?
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 ...
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 ...
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: " "; }
How do I add white space before an element's content?
Note: I need to color the ...
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 ...
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 ...
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?