How to remove extra spaces from a string??

Hi,

I have a string like this and i want to remove extra spaces that exists between the words.

Here is the sentence.


$string="The small DNA genome of hepadnaviruses is replicated by reverse       transcription via an RNA        intermediate. This RNA "pregenome"    contains       important      signals";

How can i remove these spaces??

I want output like this:


The small DNA genome of hepadnaviruses is replicated by reverse transcription via an RNA intermediate. This RNA "pregenome" contains important signals

Any ideas??

Regards
Vanitha

-----Post Update-----

use tr

echo "$string"|tr -s " "

bash

${string// /}