/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function trim(strText) { while('' + strText.charAt(0) == ' ') { strText = strText.substring(1, strText.length); } while('' + strText.charAt(strText.length-1)==' ') { strText = strText.substring(0, strText.length-1); } return strText; }