General way to convert String into Big Decimal
<p>In my Java code I have four number in text format (String):
Es.</p>

<pre><code>String s1 = "1234.56";
String s2 = "1235,56";
String s3 = "1,234.56";
String s4 = "1.234,56";
</code></pre>

<p>I want to convert these Strings into BigDecimal:</p>

<pre><code>BigDecimal b1 = new BigDecimal(s1);
...
...
</code></pre>

<p>Obviously it does not work, because BigDecimal does not accept all formats (strings with commas).
There is a general way that allows me to convert all strings in BigDecimal?</p>