Possible Duplicate:
Replace multiple whitespaces with single whitespace in JavaScript string
I have used trim function to remove the white spaces at the beginning and end of the sentences. If there is to much white spaces in between words in a sentence, is there any method to trim?
for example
"abc def. fds sdff."