Questions tagged [spaces]

The space character, `U+0020`, used to separate words/tokens in most natural and programming languages.

The space character, U+0020, used to separate words/tokens in most natural and programming languages. Space is a whitespace character.

Spaces are frequently of concern to programmers in the context of languages with significant whitespace (e.g. Python), source code indentation, and separating tokens. Separating tokens correctly is important for shell scripts, URIs, file names/paths, text processing, and string formatting. Questions regarding all of these areas are common on Stack Overflow, as spaces appearing unexpectedly can cause unexpected behavior whose source is not immediately obvious.

"Spaces" may also refer to the virtual desktop functionality of Mac OS X, first referred to as "Spaces" in OS X 10.5.

1024 questions
18
votes
7 answers

Selecting a database in mysql with spaces in its name

I want to select my particular database in mysql console, but the problem is that my database name has a space in between and mysql ignores the part after the space. For instance, when i give the command: use 'student registration' I get the…
John
18
votes
1 answer

Can git be told to use spaces in ~/.gitconfig?

When I use git config --global , Git will write the relevant entry in my ~/.gitconfig, indented by one tab. Since my ~/.gitconfig is version-controlled and I want it to not be a mess, I then have to go in by hand and…
Resigned June 2023
  • 4,638
  • 3
  • 38
  • 49
18
votes
6 answers

Add spaces to the end of some Bash autocomplete options, but not to others?

I'm trying to create a Bash completion script for a Java program. A typical invocation of that program might look like this: $ javaProgram -Dproperty=foo option1 option2 Part of my script will be to suggest the various Java properties that are…
17
votes
4 answers

Visual Studio 2019 ignoring tab preference

I was programming in VS2019 this morning before going about my day. When I sat down in the evening to keep programming, I realized that it has suddenly been placing spaces instead of tabs! My preferences are set for every language to place tabs…
17
votes
2 answers

How can I programmatically move one Terminal.app window to another space?

If I have several OS-X Terminal.app windows open, how can I move one Terminal window to another space? I'm happy to use any scripting or programming language to achieve this, but would prefer AppleScript or calls to standard frameworks. (Note this…
Gavin Brock
  • 5,027
  • 1
  • 30
  • 33
17
votes
1 answer

Converting spaces to tabs in multiple files Sublime Text 2

Is there any way to convert all spaces to tabs, not file by file? If I open a file and go through View => Indentation => Convert Indentation to Tabs, it only changes this file. I want to convert indentations to tabs in a whole project.
Sodbileg Gansukh
  • 1,730
  • 2
  • 13
  • 19
17
votes
5 answers

Removing spaces from a variable in batch

I am writing a file to remove spaces from filenames in a folder and then put the result in a .txt file. I just get a result of "Echo is on." over and over. This is what I have so far: @echo ON SET LOCAL EnableDelayedExpansion For %%# in (*.*) do…
user2313522
  • 205
  • 1
  • 4
  • 10
16
votes
2 answers

How to 'see' / highlight tabs and spaces in PyCharm for checking indentation?

this may sound dumb, but I am still fairly new, is there clear way to spot if I have tabs or spaces in the wrong place with PyCharm? Or even to display all tabs and spaces visually? I just spent ages looking for problem with 'invalid syntax' error…
Will Croxford
  • 457
  • 2
  • 7
  • 21
16
votes
1 answer

Get rid of auto spacing using bquote in r

I am attempting to label a plot axis in r using the bquote function. The desired string includes the greek mu character and a variable. This results in spaces in either side of the mu: xlab = bquote("Lake NO3 (" ~ mu ~ "mol/L): " ~ .(i)) How can I…
viridius
  • 477
  • 5
  • 17
16
votes
5 answers

Bash doesn't parse quotes when converting a string to arguments

This is my problem. In bash 3: $ test='One "This is two" Three' $ set -- $test $ echo $2 "This How to get bash to understand the quotes and return $2 as This is two and not "This? Unfortunately I cannot alter the construction of the variable called…
David
  • 265
  • 4
  • 8
14
votes
3 answers

replace spaces with _ in php

i am trying to replace spaces with underscore '_' in the following variable $e_type = 'Hello World TEST'; can anyone help me please
Rickstar
  • 6,057
  • 21
  • 55
  • 74
14
votes
3 answers

C: How to append/concatenate 'x' spaces to a string

I want to add a variable number of spaces to a string in C, and wanted to know if there is a standard way to do it, before I implement it by myself. Until now I used some ugly ways to do it: Please assume that before I called any of the below…
SomethingSomething
  • 11,491
  • 17
  • 68
  • 126
14
votes
2 answers

How do I handle files with spaces in the classpath in MANIFEST.MF?

I try to build JAR with a Class-Path element in the MANIFEST.MF. I get the elements of the class path from an outside source (Maven in my case). Since the paths are absolute and beyond my control, they can contain weird characters like spaces. Since…
Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
14
votes
4 answers

How to count space in a text statement in PHP

How can we count space between text in PHP? example: hi how are you? spaces: 3 Is there a way to count spaces? Language: Only PHP
james
13
votes
4 answers

^a-zA-Z0-9 excluding spaces?

I am trying to find everything in a paragraph that is not abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 and not space / /gi /[^a-zA-Z0-9]|[^ ]/gi the above doesn't work!
Ben Muircroft
  • 2,936
  • 8
  • 39
  • 66