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

PHP regex doesn't working in my website but works on regular expression editor

my aim for the "author name input", to be sure that only spaces and utf-8 letters are inputted. my website lang is Turkish, Turkish alphabet has non-English characters. my weird issue this regex works on rubular.com if input string : "Selim Çınar"…
Andre Chenier
  • 1,166
  • 2
  • 18
  • 37
-1
votes
2 answers

Checking for spaces in C++?

I'm writing an encryption program for class. I need to be able to track the position of spaces in a string, as well as adding 13 to the ASCII value of each character of the string. I keep getting an error in line 46, and I don't see what I'm doing…
Brandon
  • 103
  • 2
  • 2
  • 10
-1
votes
2 answers

PHP MYSQL query when I search for an item with any spaces in the name it doesnt find any results

I am building an inventory system for work, I have a search system to search the database already. But when I search for an item with any spaces in the name it doesnt find any results. Here is my script, any help would be appreciated.
-2
votes
3 answers

PHP remove space from a string

I've this piece of code to rename a file by adding the uploading date, but then I want also to remove all spaces rename("./uploads/" . "$directory/" . $mvcfile->FileName , "./uploads/" . "$directory/" . $data . "_" . $mvcfile->FileName); I've tried…
Miwi
  • 774
  • 4
  • 15
  • 28
-2
votes
2 answers

Why do I get extra spaces in an integer list while doing list operations in python3?

num = [100,1,82,-1] print(sorted(num)) The above piece of code give the following output: [-1, 1, 82, 100]. However, I need it to be like [-1,1,82,100]. But so far I have been unable to figure out why does Python add whitespaces in a list with any…
-2
votes
1 answer

Check Variable for Blank Spaces

I have a variable called location that users put a URL in. I was able to take that URL and convert it to an HTML link. I found out though if the user puts a link in with a space, where there should be a %20, the HTML link breaks. Here is my code to…
Schmit
  • 41
  • 5
  • 12
-2
votes
2 answers

Word VBA replace multiple spaces

I work with users all over the world, many of whom don't seem to know what the tab key is for, or who insert multiple spaces - both normal and non-breaking - between sentences. Our corporate standard is to have only one space between sentences. I'd…
hmm
  • 11
  • 1
  • 8
-2
votes
1 answer

How can I remove whitespaces (multiple space, tab, nextline) from the input code in Python programming?

How can I remove whitespaces (multiple spaces, tab, nextline) from the input code in Python programming? For example, input = "p y t h o n e x e r c i s e s" or input = "python exercises" or input = "python exercises\n" I want to show just a…
-2
votes
1 answer

How to read in integers, separated by commas and spaces, into a 2D array?

I have an input file that looks like this: 3, 2, 5 2, 4, 9 6, 5, 9 And I've made an array[3][3]. My question is: how can I read this into my array, while skipping the spaces and commas? Also: I can't use stoi (don't have C++11) and I haven't…
-2
votes
1 answer

Why does an IF in python outputs an error?

I'm doing a little program in tkinter, but it doesn't works, cause when I press F5 to execute the code, A pop-up appears saying: Tab/space error .Here is my code: def codigo(): global text2 f2=Frame(f, width=300,…
user11648714
-2
votes
7 answers

validating textbox in windows form applications

My scenario is: Not allowing spaces at starting position of textbox after enter one or more characters text box allows spaces Below not applicable to my scenario. private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { if…
Ranagababu
  • 7
  • 1
  • 2
  • 3
-2
votes
1 answer

How To Read a File That Has Spaces In Its Name in C

I'm trying to open a file to read its content, but when it has spaces in its name (like lot of spaces.txt), it doesn't even open it. How can I do that? I searched on the internet but only found the backslash \ solution (add a backslash before every…
IncredibleCoding
  • 191
  • 2
  • 14
-2
votes
2 answers

How to replace double spaces with one space in filenames (also subdirectories) (CloudLinux Server release 6.10)

I want to replace double spaces with one space in the filenames of a lot of photos. These photos are located in directory /foto and it's subfolders. How to do this? For example "photo 1.jpg" needs to become "photo 1.jpg" The best way is to use…
Gijsve
  • 78
  • 2
  • 11
-2
votes
2 answers

Removing all spaces, tabs from a .txt file

I want to remove all spaces and tabs from a txt file. Below is my code with which I am trying to do this: for /F "delims=" %%a in (CODE_CHECK.txt) do ( set one=%%a set one=%one:=% ) >> CODE_CHECK_2.txt Example file lines: ONE VIEW TWO…
Raitis Lebedevs
  • 47
  • 1
  • 13
-2
votes
2 answers

My Code for Erasing Empty Spaces in a Sentence in C++ has an Issue

I have made this code such that whatever I type in a sentence has the first letter of the first word capitalized; While reducing any number of spaces in a sentence to just one space. However, my sentences are only reducing by one space. For example,…