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

Tab space inconsistency in a txt file using PHP

I have generated this attached file uploaded here: https://files.fm/u/uqm4marg This file was generated using PHP. \t was used to insert a tab space. It has worked find through out the entire file but for the tab space between INR0564 D and INR0564…
Nihilarian
  • 1,190
  • 1
  • 10
  • 17
-1
votes
1 answer

Awk command to search two patterns in string and substitute with fixed value

Second pattern gsub(/FHD/,"HD",val) is working First pattern gsub(/" 1"/;"+1",val) is not working dont know how to put all in one regex. Input (pattern to be found is " 1" and "FHD"): Abc Sort 3 1 FHD Dcef Raz 1 1 FHD Hgd 1 1 FHD Und der…
Francesco
  • 11
  • 3
-1
votes
2 answers

How to use PowerShell to remove spaces after ID's listed in a .csv using Powershell

I have a CSV that is manually updated occasionally with ID's of users here at work. I have code that does a compare on the list but some of the ID's have spaces after them so they aren't matching. How do I do a data integrity check on this CSV to…
-1
votes
1 answer

How to ignore spaces in Vigenere cipher code?

I have two functions: function EnCryptSymbolVij(text, key:char; abc:string):char; var st: string; positionText: word; begin if text=' ' then begin EnCryptSymbolVij:=' '; exit; end; PositionText:=pos(text,abc); if positionText=0 then exit; …
-1
votes
2 answers

Regex to replace spaces in part of a string in javascript

I'm implementing the srcset attribute on some images within a site and hit an issue because Chrome doesn't like srcset image urls that contain spaces. My source HTML has a number of image tags which look like: My…</div>
        <div class=
Code Ninja
  • 727
  • 1
  • 7
  • 9
-1
votes
1 answer

How to add leading white space (spaces) in TextView (Android)

I am trying to add leading white space (spaces) to the string displayed in my TextView when I use setText(), but TextView just removes them from the String. For example, say I want to display " 328". I call textView.setText(" 328"), but what is…
MarkInTheDark
  • 244
  • 2
  • 15
-1
votes
1 answer

Bash Function Space in single Argument

I am new to the console, and attempting to write a function that will create a directory with the name of the directory being the function argument. This is my function so far: clidir() { mkdir $1 } Whenever I enter an argument with a space, it…
Mitchbart
  • 3
  • 2
-1
votes
2 answers

Weird error when using spaces instead of tab in Python

I am working on a simple GUI using pygame. At some point I was fed up with the constant indentation errors due to tabs and spaces mixing, so I decided to use vi to replace all tabs with 4 spaces. After that I get some error about pygame.font.SysFont…
F. Pareto
  • 304
  • 2
  • 10
-1
votes
1 answer

Black magic in powershell output redirection

I've been looking around the web for the past week to solve this issue, but I'm almost sure now that there is no solution, so this is a good challenge for many of you I guess :) In a prod environment we are using powershell scripts to automate some…
-1
votes
2 answers

How to print a descending/ascending number of spaces in Java?

I'm trying to print a figure that prints 3 spaces then a star, then the next line prints 2 spaces, / and a star, and then 1 space, // and a star and so on. I've got the code to print all the slashes and stars, but I can't figure out how to get the…
-1
votes
2 answers

How can I make std::cin read spaces?

I know this question has been asked a bit on this site before, but I can't seem to grasp how to get it to work with my particular program. Essentially, I am creating a little MadLibs type of game, where the player has to enter in certain things in…
MTS
  • 87
  • 8
-1
votes
2 answers

Replace some but not all spaces in text file (shell/bash)

Let's say that I have a file (example.txt) with the next structure: NAAME 111 2222 333 NAMME 111 22 333 NNA ME 444 555 2 NNAAME 1 5 8 N MEEE 44 66 111 I would like to replace the spaces between the numbers with a separator, like | or , but not…
-1
votes
2 answers

How to save "NULL" instead of spaces in SQL Server?

It's pretty simple I have some textboxes to fill up and submit to SQL Server, some of them may be blank, so whenever I run the query, I get a bunch of spaces instead of the word Null in the database.. My query goes like : var qry = "INSERT INTO…
user2962142
  • 1,916
  • 7
  • 28
  • 42
-1
votes
3 answers

split a string with the space bar

The follow are my java code i want to enter: asd 123456 hellohello output: asd 123456 hellohello However it come out error. anyone can help me? package test; import java.util.Scanner; public class test1 { public static void main(String[] args)…
T Lam
  • 13
  • 3
-1
votes
3 answers

C - Delete spaces around specific char in string

I have a string of 80 chars (line from .txt file) Somewhere at the end of the string I have numbers or strings or chars and "," (comma) between them. I need to delete these spaces around "," so I will be able to get them by strtok(). Any ideas ?…