jQuery trim string

function dotrim(strComp) {
    return strComp.replace(/^\s+|\s+$/g, '');
}