Split string containg dash/hyphen character in Java
<p>I have a string</p>
<blockquote>
<p>May 1988 – June 1992</p>
</blockquote>
<p>I want to split this string in such way that I will get two separate strings <strong>May 1988</strong> and <strong>June 1992</strong> .</p>
<p>I tried the following code:</p>
<pre><code>String sample=&quot;May 1988 – June 1992&quot;;
String[] arr=sample.split(&quot; - &quot;);
</code></pre>