0

I am trying to fix on some content that is generated by a remote server I have no control over.

Here are the contents:

<span>
    <span>Text 1</span> additional text1 <---- notice there is one additional space after text1
    <span>Text 2</span>
    <span>Text 3</span>
    <span>Text 4</span>
</span>

The problem here is I want to show:

Text 1 additional text1Text 2

instead of:

Text 1 additional text1 Text2

For some reason, the remote server generates one additional whitespace character. Is there a way to remove that space?

Nathaniel Ford
  • 16,853
  • 18
  • 74
  • 88
BonJon
  • 739
  • 1
  • 7
  • 18
  • 1
    Possible duplicate of (clicked on wrong link). Will fix shortly but this can easily be found searching on SO where this question gets asked too often. – Rob Nov 20 '15 at 19:26
  • 3
    Possible duplicate of [How to remove the space between inline-block elements?](http://stackoverflow.com/questions/5078239/how-to-remove-the-space-between-inline-block-elements) – Michael Victor Nov 20 '15 at 19:27
  • The problem here is additional text1 is not inside any tag. – BonJon Nov 20 '15 at 19:31
  • @BonJon That's not completely true: there are encapsulating `span` tags. A CSS solution may therefore be possible. – Nathaniel Ford Nov 20 '15 at 19:38
  • Could be there is no space after span, but span had a margin maybe? – Pablo Nov 20 '15 at 19:39
  • @Pablo no that's not the case for me. Nathaniel Ford Could you please provide an example? Thank you guys – BonJon Nov 20 '15 at 19:41

1 Answers1

0
<span>
    <span>Text 1</span> additional text1<!--
 --><span>Text 2</span>
    <span>Text 3</span>
    <span>Text 4</span>
</span>

And there are many other ways to solve it as well (as linked above by Michael Victor).

Brian FitzGerald
  • 2,773
  • 3
  • 21
  • 33