Questions tagged [removing-whitespace]

For issues related to removing additional blank-characters like spaces, tabs and new lines or issues related to removing unwanted whitespace.

Related tags:

756 questions
65
votes
13 answers

In Haskell, how do you trim whitespace from the beginning and end of a string?

How do you trim whitespace from the start and end of a string? trim " abc " => "abc" Edit: Ok, let me be a little clearer. I did not understand that string literals were treated so differently from Strings. I would like to do this: import…
Eric Normand
  • 3,806
  • 1
  • 22
  • 26
61
votes
8 answers

My diff contains trailing whitespace - how to get rid of it?

I've tried editing a php file in TextWrangler with line endings set to Unix, in NetBeans, and in vim. When I save the diff to a patch and then try to apply it, it gives whitespace errors. When I type git diff I can see ^M at the ends of my lines,…
beth
  • 1,916
  • 4
  • 23
  • 39
58
votes
10 answers

Remove the Extra Whitespace Surrounding Iframes?

I am using iframes in my page, and have stumbled across a weird issue. I set the iframe css like so iframe { margin: none; padding: none; background: blue; /* this is just to make the frames easier to see */ border: none; } However,…
Colin Atkinson
  • 986
  • 1
  • 9
  • 18
57
votes
28 answers

c# Fastest way to remove extra white spaces

What is the fastest way to replace extra white spaces to one white space? e.g. from foo bar to foo bar
Navid Rahmani
  • 7,848
  • 9
  • 39
  • 57
49
votes
5 answers

Trim trailing spaces with PostgreSQL

I have a column eventDate which contains trailing spaces. I am trying to remove them with the PostgreSQL function TRIM(). More specifically, I am running: SELECT TRIM(both ' ' from eventDate) FROM EventDates; However, the trailing spaces don't go…
zgall1
  • 2,865
  • 5
  • 23
  • 39
47
votes
5 answers

git: change styling (whitespace) without changing ownership/blame?

We have a massive, ancient codebase that needs a lot of cleanup. We have always had coding standards and everyone has always tried to follow them, but they were not enforced so over time a lot of violations have creeped in. Many of them are just…
Jay Paroline
  • 2,487
  • 1
  • 22
  • 27
46
votes
1 answer

Removing whitespaces in HAML

Is there a way to achieve this in HAML?

Lorem ipsumdolor

I used this online tool conversor (http://html2haml.heroku.com/) %h1 Lorem ip %span.red sum %span.subtitle dolor and…
xbelanch
  • 844
  • 1
  • 12
  • 21
41
votes
10 answers

How to remove extra spaces in bash?

How to remove extra spaces in variable HEAD? HEAD=" how to remove extra spaces " Result: how to remove extra spaces
Charlie
  • 2,061
  • 4
  • 21
  • 21
39
votes
5 answers

Remove all whitespace from a string

How do I remove all white space from a string? I can think of some obvious methods such as looping over the string and removing each white space character, or using regular expressions, but these solutions are not that expressive or efficient. What…
Magix
  • 4,989
  • 7
  • 26
  • 50
32
votes
8 answers

How can I eliminate spacing between inline elements in CSS?

I have a div with a bunch of image tags inside, here is an example:
Foo1 Foo2
Jake Petroules
  • 23,472
  • 35
  • 144
  • 225
30
votes
4 answers

Remove white space below footer

There's always a large empty white space below my footer. How do I ensure that the page ends at the end of the footer?
lagertha281
  • 311
  • 1
  • 4
  • 3
30
votes
6 answers

How to remove multiple spaces in Strings with Swift 2

Until Swift 2 I used this extension to remove multiple whitespaces: func condenseWhitespace() -> String { let components =…
headkit
  • 3,307
  • 4
  • 53
  • 99
29
votes
2 answers

Mysterious whitespace in between Bootstrap2 Navbar and row underneath

I am using Bootstrap's Navbar and Bootsrap's grid to display a Navbar with a image immediately underneath the Navbar. However, for some reason there is whitespace between this Navbar and the image. When I use firebug to investigate the location of…
BigSauce
  • 1,830
  • 3
  • 21
  • 27
26
votes
3 answers

Removing more than one white space in powershell

I was trying to find a way in powershell to remove more than one white space. But what i found is how to do it in php. "Removing more than one white-space" There will be similar regular expression may available . How to acheive the same in…
Samselvaprabu
  • 16,830
  • 32
  • 144
  • 230
22
votes
6 answers

(Django) Trim whitespaces from charField

How do I strip whitespaces (trim) from the end of a charField in Django? Here is my Model, as you can see I've tried putting in clean methods but these never get run. I've also tried doing name.strip(), models.charField().strip() but these do not…
zardon
  • 2,910
  • 6
  • 37
  • 58
1
2
3
50 51