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
8
votes
2 answers

Tesseract False Space Recognition

I'm using tesseract to recognize a serial number. This works acceptable, common problem like false recognition of zero and "O", 6 and 5, or M and H exists. Beside by this tesseract adds spaces to the recognized words, where no space is in the…
Mr.Sheep
  • 1,368
  • 1
  • 15
  • 32
8
votes
2 answers

Can you detect Mac Spaces in Java?

I have a java application that was mainly built for the Mac. I need to be able to do either one of three things: Have my application always follow the current space. Meaning, if I'm on Desktop 2 and start my app, then I switch to Desktop 3, my…
dream_team
  • 511
  • 5
  • 9
7
votes
5 answers

How can I read a string with spaces in it in C?

scanf("%s",str) won't do it. It will stop reading at the first space. gets(str) doesn't work either when the string is large. Any ideas?
Johny
  • 319
  • 2
  • 5
  • 10
7
votes
2 answers

CKEditor remove spaces/tabs from between headings

CKEditor does this whenever I add a heading tag:

Mai 2010

How can I remove the new line and spaces after the h2 starting tag, please?
Francisc
  • 77,430
  • 63
  • 180
  • 276
7
votes
1 answer

Inserting Spaces Instead of Tabs in ALL Files

Our unit testing setup makes sure you use spaces instead of tabs in all files, including .jsp and jspx. I have set this option for the general editor but the jsp editor does not recognize/see this option and still continues to use tabs instead of…
bobber205
  • 12,948
  • 27
  • 74
  • 100
7
votes
3 answers

gradle: Execute task "type:Exec" with many arguments with spaces

I have the gradle task that should create Websphere profile on Windows OS task createProfile(type:Exec) { def commandToExecute = new StringBuffer() def profile = 'AppSrv02' def wasHome = 'C:/IBM new/WebSphere/AppServer' def str =…
serg
  • 1,003
  • 3
  • 16
  • 26
7
votes
2 answers

Doskey macro with spaces in passed variable?

I am creating some common doskey commands I use on a regular basis. I am trying to have multiple variables in the doskey macro and sometimes a variable will have spaces in it. I have tried quoting the variable values but it won't work. The only…
rolinger
  • 2,787
  • 1
  • 31
  • 53
6
votes
2 answers

Should environment variables that contain a executable-path with spaces also contain the necessary quotes?

When defining an environment variable (on Windows for me, maybe there is a more general guideline) set MY_TOOL=C:\DevTools\bin\mytool.exe if the tool is located on a path with spaces set MY_TOOL=C:\Program Files (x86)\Foobar\bin\mytool.exe should…
Martin Ba
  • 37,187
  • 33
  • 183
  • 337
6
votes
4 answers

What's wrong with putting spaces in $_GET variables

If I for example have my url looking like index.php?category=IT%20&%20Soft. Then i try to print "$_GET[category]" i only get "IT" and not "IT & Soft". What is wrong here? It's frustrating me.
ionescho
  • 1,360
  • 2
  • 17
  • 31
6
votes
7 answers

Regular Expression in C# for Last Name that includes internal space

I'd like a Regular Expression for C# that matches "Johnson", "Del Sol", or "Del La Range"; in other words, it should match words with spaces in the middle but no space at the start or at the end.
Caveatrob
  • 12,667
  • 32
  • 107
  • 187
6
votes
3 answers

How replace all spaces inside HTML elements with   using preg_replace?

I need replace spaces with   inside HTML elements. Example:
adfa a adfadfaf>
dfa dfa
should become
adfa a   adfadfaf>
Pro85
  • 63
  • 1
  • 1
  • 3
6
votes
1 answer

Spaces vs. Tabs -- Best Practice?

I used to be a tab freak -- I would always use tabs to indent my source code, and if I saw any spaces, I would instantly do a regex search/replace to replace all leading spaces with tabs. ...until I realized that I hadn't noticed the presence of a…
user541686
  • 205,094
  • 128
  • 528
  • 886
6
votes
4 answers

bash - Remove all Unicode Spaces and replace with Normal Space

I have a file with a lot of text, and mixed there are special space characters, those are Unicode Spaces I need to replace all of them with the normal "space" character.
Kuzeko
  • 1,545
  • 16
  • 39
6
votes
5 answers

bash: How to add space in string?

I have a string like this: string="aaa-bbb" But I want to add space before char '-', so I want this: aaa -bbb I tried a lot of things, but I can't add space there. I tried with echo $string | tr '-' ' -', and some other stuff, but it didn't…
Marta Koprivnik
  • 385
  • 2
  • 3
  • 10
6
votes
2 answers

Keep spaces with YAML

I have this in my YAML file: test: I want spaces before this text In my case I would like to have a space before the text in my array or json when converted. Is that possible? How? With JSON as output it's parsed like this: { "test": "I want…
Jens Törnell
  • 23,180
  • 45
  • 124
  • 206