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

File and space in Python

I have a file like: line1 column 1 column 2 column 3 ... . . . How to remove this extra spaces? I need to extract the heading which will be on line1. Also, I need to extract column 1, column 2,…
user46646
  • 153,461
  • 44
  • 78
  • 84
-2
votes
2 answers

How to scan in unknown number of integers separated by spaces in C?

I'm trying to work on a program where the user enters a matrix of size nxn where n is 10 or less, and the program has to rotate it by 90, 180, 270 degrees etc. The user will first enter how big the matrix will be ("enter n: ") and then will proceed…
John
  • 9
  • 2
-2
votes
3 answers

If statement help on when to use commas and spaces

Basically I've built up a string and I need to put an if statement on when to use a comma and a space. So basically I need it be after the first element and not on the last element. This is what my current code is: And the output it returns…
John
  • 63
  • 7
-2
votes
2 answers

Aligning text without tabs - java

Hey every one I just need some help with formatting some code, I'm supposed to make a table, however I can't seem to get the alignment correct. So far this is the code I've gotten: public class assignment2 { public static void main(String[]…
-2
votes
1 answer

Problems at detecting spacebars at Strings

So I'm doing a program that takes a user input and when it finds chars that are similar to numbers, it replaces it by the number. (For example, it replaces O's by 0's, e's by 3's, etc) The problem is that when it finds a blank space it all messes…
Otomeram
  • 13
  • 1
  • 5
-2
votes
2 answers

Remove Spaces in HTML Message Box

I have a contact form on my site that has four text boxes. It is like a normal contact form, but in the "message" box (which is an html textarea), there are random spaces that show up every time the page loads. The placeholder does not show unless…
-2
votes
5 answers

Remove spaces in a string

I have this function: def cesar(): n = int(raw_input("Introdueix la teva clau: ")) f = raw_input("Introdueix la frase a xifrar: ") for ch in f: xifrat = int(ord(ch)+int(n)) textxifrat = chr(xifrat) print…
-2
votes
1 answer

Don't take capital letters/spaces in consideration

For our workgroup we've got to write a program that detects whether the given phrase is a "palindrome" (in other words, when one reverts the entire phrase, it still says the same). Now that does sound easy at first sight but the program must be able…
Very good
  • 1
  • 1
-2
votes
1 answer

Tricky variable setting from a text file

I have a windows batch file that reads in various lines of a text file for processing. During the execution I have to open another text file that has only one line in it. The line contains a serial number with about 3 or 4 spaces after the end. I…
-2
votes
4 answers

Concatenating certain parts of a list. Removing spaces.

I have a list of names split up letter by letter, I would like to concatenate the individual names together. This is what I currently have: ['S', 't', 'u', 'a', 'r', 't', ' ', 'S', 't', 'e', 'v', 'e', ' ', 'A', 'n', 'd', 'r', 'e', 'w', ' ', 'L',…
Shaney96
  • 75
  • 1
  • 9
-2
votes
2 answers

C# Replace multiple spaces in a string with newline

This questioned has been asked before in regard to other languages but I could't find anything on using regex or any other algorithm to solve this in C#. For example: Photosynthesis maintains atmospheric oxygen levels and supplies all of the…
WyldeBoyy
  • 35
  • 8
-2
votes
1 answer

printing from file to console and other file

I'm reading this lines from a file yara_rule1: rule match: problem: yara_rule2: rule match: problem: when I print it into console the spaces before "rule match" and "problem" are omitted . what is the problem input_data =…
user3832061
  • 477
  • 3
  • 7
  • 12
-2
votes
4 answers

Replace with sed ; and whitespaces

i need to replace with sed command this lines: ;[homes] ; browseable = no In this lines: [homes] browseable = yes
-2
votes
2 answers

R How to extract info from xml tags

I have a question regarding xml parsing. I have tags with spaces in e.g. 1254 1254 How do I extract the id and name out of this tags? I'm now using R as I need for the rest of my…
pepe456
  • 23
  • 1
  • 4
-2
votes
1 answer

triming records everything after 7 characters

I am trying to remove/trim everything after 7 characters. issue #1 removing everything after 6 or 7 chracters example: 1Q7 4B7 MY NAME IS MARY Results I want: 1Q7 4B7 issue #2 removing one space example: EQ9 2IQ Results I want: EQ9 2IQ Please…