title: Removing spaces from a EUR currency string in Java
body: <p>I have a method that convert a number into a currency, for &quot;USD&quot; and &quot;GBP&quot; it's working good, but with &quot;EUR&quot; the NumberFormat it's rendering a string with a space between the symbol and the number <code>€ 1.207.987,00</code> rather then dollar and pound <code>&quot;$1,207,987.00&quot;</code>, <code>&quot;£1,207,987.00&quot;</code>. I tried use replace and replace all to remove this but nothing works for me, follow the code:</p>
  <pre><code> public static void main(String[] argsd) {
          Number rawNumber = 120798700;
           NumberFormat numberFormat = NumberFormat.getCurrencyInstance(Locale.forLanguageTag(&quot;nl&quot;));
           Currency currency = Currency.getInstance(&quot;EUR&quot;);
           numberFormat.setCurrency(currency);
           String numberRemoveSpaces = numberFormat.format((rawNumber.floatValue() / 100)).replaceAll(&quot;\\s+&quot;, &quot;&quot;);
          System.out.println(numberRemoveSpaces);
      }
  </code></pre>