Return to Snippet

Revision: 8280
at September 11, 2008 10:12 by DaveChild


Initial Code
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;
}

Initial URL


Initial Description


Initial Title
JavaScript Trim String

Initial Tags


Initial Language
JavaScript