Possible Duplicate:
Removing whitespace from string in JavaScript
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."