function trimStr(str) 
 
var re = /\s*(\S[^\0]*\S)\s*/
 re.exec(str); 
 
return RegExp.$1
}