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
4
votes
4 answers

Remove preceding spaces and tabs from a given string in C language

What C function, if any, removes all preceding spaces and tabs from a string?
goe
  • 5,207
  • 14
  • 45
  • 49
4
votes
2 answers

Octave strcat ignores added spaces

Octave adds spaces with strcat In Octave I run these commands: strcat ("hel", " ", "lo") I get this result: ans = hello Instead of what I expected: ans = hel lo strcat to me sounds like "concatenate strings". A space is a valid character, so…
Eric Leschinski
  • 146,994
  • 96
  • 417
  • 335
4
votes
1 answer

makefile: trailing spaces in variable value

I'm reading the following in GNU make manual: if you do not want any whitespace characters at the end of your variable value, you must remember not to put a random comment on the end of the line after some whitespace, such as this: dir :=…
password636
  • 981
  • 1
  • 7
  • 18
4
votes
1 answer

Visual Studio 2012: change javascript comment style

When I comment out a line in a javascript file in Visual Studio using the shortcut or toolbar button, there is no space before the comment text. //the way comments are currently formatted I would like to have a space automatically added before the…
dmr
  • 21,811
  • 37
  • 100
  • 138
4
votes
4 answers

Using white spaces in an rsync file path excecuted in a batch file

So I'm using rsync to back up some commonly used directories, using a batch script and windows scheduler as seen here: rsync.bat @echo off C: chdir C:\Cygwin\bin bash --login -i -c %1 I'm using Windows Scheduler to run this batch script on…
taylorthurlow
  • 2,953
  • 3
  • 28
  • 42
4
votes
2 answers

Imagemagick font_stretch or spacing between letters?

I am generating some buttons using ImageMagick. However, I am not able to set the spacing between the letters in generated image. Command which I use: convert -gravity center button_subscribeme.png -font…
bluszcz
  • 4,054
  • 4
  • 33
  • 52
4
votes
3 answers

Runtime.exec() with absolute directory

I would like to use Runtime.exec() to initiate another process in a directory with spaces. (It sounds stupid but I really want to satisfy my curiosity) Details of the problem(simplified version) I have a myprogram.exe locates in C:/Program…
Lily
  • 5,872
  • 19
  • 56
  • 75
4
votes
5 answers

Python split semantics in Java

When I split a string in python, adjacent space delimiters are merged: >>> str = "hi there" >>> str.split() ['hi', 'there'] In Java, the delimiters are not merged: $ cat Split.java class Split { public static void main(String…
Andrew Prock
  • 6,900
  • 6
  • 40
  • 60
3
votes
3 answers

Default Pages for new Spaces in Confluence

Does anyone know, if it is possible to prepopulate new Confluence Spaces with specific Pages? What I want to have when creating a new Space is the following default structure: Home |_ Category A |_ Category B |_ Category C |_ Category D I read the…
Dominik Obermaier
  • 5,610
  • 4
  • 34
  • 45
3
votes
1 answer

Vim Highlight Trailing Whitespace AND Spaces Before and After Tabs

I got this from the vim wiki and added it to my .vimrc to highlight trailing whitespace, and spaces before tabs (only when in insert mode): highlight ExtraWhitespace guibg=purple match ExtraWhitespace /\s\+$\| \+\ze\t/ autocmd BufWinEnter * match…
user1186344
  • 31
  • 1
  • 2
3
votes
4 answers

How to search and replace a text that has spaces before the text?

I have a code that search if a line begin with a specified word and if it does, it changes that whole line with a specified input. However, it doesn't work for some lines if the line is indented by spaces? Is there a way to read the text directly…
mikeP
  • 801
  • 2
  • 11
  • 20
3
votes
3 answers

What are the rules for spaces in Ruby?

a = [2,4,5] a.count-1 => 2 a.count - 1 => 2 But a.count -1 => 0 What causes this behavior? Why doesn't it happen if a is an integer (and not an array)? Also, I have noticed that there must not be a space between a method name and the parenthesis…
B Seven
  • 44,484
  • 66
  • 240
  • 385
3
votes
2 answers

git-svn dcommit fails because the repository name contains a space

When attemping to git svn dcommit to a repository that has spaces in it's name, I get the following error: Committing to http://svn.kuluvalley.com/Meet the Expert/trunk ... http://svn.kuluvalley.com/Meet the Expert/trunk Filesystem has no item:…
Karl
  • 1,615
  • 1
  • 14
  • 20
3
votes
2 answers

NGINX Thumbnail Generation won't work with spaces or %20 in Ubuntu 22 but did in Ubuntu 16 - Nginx 1.23.0 specific

Please see update at the bottom regarding the Nginx version 1.23.0 being the cause I've been using NGINX to generate image thumbnails for a number of years, however having just switched from Ubuntu 16 to Ubuntu 22 and Nginx 1.16 to nginx 1.23 it no…
John Mellor
  • 2,351
  • 8
  • 45
  • 79
3
votes
3 answers

Correct Amount of Spaces with concatenated person's name in SQL Server

Here is my SQL as I have it now. The first and last name should never be missing because they are required on the interface with validation. However, if the middle initial is missing, I don't want two spaces in the result; I just want one space. …
JustBeingHelpful
  • 18,332
  • 38
  • 160
  • 245