javascript string Trim() frunction
Hi,
Here is the smart Javascript function for remove additional spaces from a string using regular expressions
function Trim(s) {
var m = s.match(/^\s*(\S+(\s+\S+)*)\s*$/);
return (m == null) ? "" : m[1];
}
Enjoy and share this with your friends.
Suresh Kumar Thanda
Microsoft Application Developer
Sr .Net Developer
|