Given a string like:
\"The dog has a long tail, and it is RED!\"
What kind of jQuery or JavaScript magic can be used to keep spaces to only o
Jquery has trim() function which basically turns something like this " FOo Bar " into "FOo Bar".
var string = " My String with Multiple lines ";
string.trim(); // output "My String with Multiple lines"
It is much more usefull because it is automatically removes empty spaces at the beginning and at the end of string as well. No regex needed.