Formatting a string
<p>I have got a string in the form:</p>

<pre><code>8 AM;10:15 AM;3:30 PM;6:15 PM
</code></pre>

<p>which i need to format in the form</p>

<pre><code>8 AM-10:15 AM, 3:30 PM-6:15 PM
</code></pre>

<p>How can i achieve this?</p>
