// Trim in Javascript, JQuery, Trim in JQuery
//this.replace(/^\s*/, "").replace(/\s*$/, "")
pc6_summary = ($('#pc6-summary').val()).replace(/^\s*/, "").replace(/\s*$/, "");
room_title = ($('#room_title').val()).replace(/^\s*/, "").replace(/\s*$/, "");
// Implementing Trim Function for strings in JQuery, Trim Function for strings in Javascript, a trim function for strings in javascript
< script language="JavaScript" type="text/javascript" >
String.prototype.trim = function () {
return this.replace(/^\s*/, "").replace(/\s*$/, "");
}
var s = new String(" Hello ");
// use it like this
s=s.trim();
alert("!" + s + "!");
// end hiding contents -->
< /script >