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

How to remove 2 or more spaces that are next to each other from a char array

public static void removeDuplicateSpaces(char[] characters) { int dupCount = 0; for (int i = 0; i < characters.length; i++) { if (characters[i] == ' ' && characters[i + 1] == ' ') { dupCount++; for (int j =…
bsharp313
  • 11
  • 1
-1
votes
1 answer

How can I skip spaces when parsing a haskell string

I have the following definition in a parser using the Haskell ReadP library: expr = chainl1 comp (string "===" >> return fun6) How can I skip spaces before the === operator? I don't know how to include it in this syntax.
Ezis
  • 73
  • 8
-1
votes
1 answer

Prevent AngularJS to remove spaces

How to prevent AngularJS to remove spaces when I do an interpolation? What angularJS does: {{"1 / 1"}} => 1/1 What I want: {{"1 / 1"}} => 1 / 1 Thank you for your help.
Sierpinski
  • 81
  • 2
  • 10
-1
votes
2 answers

White Spaces Java Text File

Is is possible to remove the white spaces of a String in a text file in Java? I have tried my approach but doesn't working. public static void main(String[] args) throws IOException { File f = new File("ejer2.txt"); BufferedReader br = new…
Ricki
  • 141
  • 3
  • 16
-1
votes
1 answer

How to tell java to ignore spaces

I have a string that I am trying to execute. The string contains a path to a MacOS .x file, which has a space in the path name. When I run it Java is telling me that it cannot run the program. "/Users/brianallison/Documents/Java/RELAP5…
-1
votes
1 answer

Handle character arrays that include spaces

I'm working on a program that has you enter your name, and the program then puts it into a square. For example, for the input "Zyad" I would expect the output: ******** | | | Zyad | | | ******** Now I want to be able to enter two…
Zyad Sabry
  • 1
  • 1
  • 3
-1
votes
1 answer

How do I prove that basis transformation property?

if space X can be described by basis b1,b2,b3,b4,b5, then if i can find some subspace of X which can using linear combination of basis b10,b20,b30,then can I found out b40,b50 and prove they(b40,b50) must exists? It's a question came out of looking…
femto
  • 80
  • 6
-1
votes
2 answers

Word palindrome in C

My task is to find word palindromes in a text file and to NOT print them into results file. The results file should only contain all the spaces and words that are NOT palindromes. I've been working on this program for two solid weeks, but as I am a…
Pa2k3l1s
  • 1
  • 6
-1
votes
2 answers

PHP - remove spaces infront of text inside of a string

Okay, this is probably a pretty basic problem but I can't solve it. I have a String like this one: ' This is a text' and now I wan't to remove the spaces infront of the first character of the string. I tried using preg_replace but I can only…
wlfkd
  • 11
-1
votes
3 answers

Use scanf(), gets() or fgets() function?

I am trying to encrypt a string by Caesar encryption, but it only works for one word (no spaces between characters). I would like to encrypt whole sentence. I have read here about getting white spaces from keyboard into a string by gets() or…
Dounchan
  • 319
  • 3
  • 10
-1
votes
3 answers

JSTL: I want to generate white spaces

I have a jsp that uses JSTL to manage the value of the beans and I need to align two elements without touching the rest of the page (that was not written by me) I have two rows like this: AAAAAAAAAAAAAAAA element one element two IF…
Pipkin
  • 99
  • 1
  • 2
  • 7
-1
votes
1 answer

R:Define data frames in a similar space

Is there a way in R to define data frames in a similar space. So lets say I have an unknown number of data frames to be created (say there will be n data.frames) I want to define a space as such: space<-data.frame.space() for(i in 1:n)…
asosnovsky
  • 2,158
  • 3
  • 24
  • 41
-1
votes
3 answers

Why is this simple text replacement code not working?

With text like this in a *.docx file: I scream. You scream. We all scream for ice cream. I scream.You scream.We all scream for ice cream. ...(IOW, two spaces between sentences in the first case, and no spaces in the second case) I want to…
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
-1
votes
2 answers

remove a tab/ space in c program

I'm trying to prevent printing a trailing tab at the end of each row of output. How can I do this? The rest of the code works as I need it to #include int main() { int i, j, k, y, z, x, c, b, a, C; scanf("%d", &x); for(i=0;…
-1
votes
3 answers

Removing whitespace from a list in python

I am currently making a cipher program in python but I can't seem to solve this one problem: word = ['a', 'b', 'c'] -----enciphering process------- message = ['d', 'e', 'f'] print message[x], What I want to happen: 'def' What actually happens: 'd…