I have some text which looks like this -
\" tushar is a good boy \"
Using javascript I want to remove all the extra white spac
This can be done in a single String#replace call:
String#replace
var repl = str.replace(/^\s+|\s+$|\s+(?=\s)/g, ""); // gives: "tushar is a good boy"