function _capFirst(str) {
        if (str === undefined)
            return "";
        return str.replace(/\w\S*/g, function (txt) {
            return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
        });
    }
// Capitalizes first letter of every new word.
Capitalizes first letter of every new word.
Capitalizes first letter of every new word .
function _capFirst(str) {
        if (str === undefined)
            return "";
        return str.replace(/\w\S*/g, function (txt) {
            return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
        });
    }
function _capFirst ( str ) { if ( str === undefined ) return "" ; return str . replace ( / \w\S* / g , function ( txt ) { return txt . charAt ( 0 ) . toUpperCase ( ) + txt . substr ( 1 ) . toLowerCase ( ) ; } ) ; }
Capitalizes first letter of every new word.
Capitalizes first letter of every new word .