trunk/research/players/js/winlin.utility.js
/**
 * trim the start and end of flag in str.
 * @param flag a string to trim.
 */
trim the start and end of flag in str.
@param flag a string to trim.
trim the start and end of flag in str . @param flag a string to trim .
function system_string_trim(str, flag) {
    if (!flag || !flag.length || typeof flag != "string") {
        return str;
    }
    while (system_string_startswith(str, flag)) {
        str = str.substr(flag.length);
    }
    while (system_string_endswith(str, flag)) {
        str = str.substr(0, str.length - flag.length);
    }
    return str;
}
function system_string_trim ( str , flag ) { if ( ! flag || ! flag . length || typeof flag != "string" ) { return str ; } while ( system_string_startswith ( str , flag ) ) { str = str . substr ( flag . length ) ; } while ( system_string_endswith ( str , flag ) ) { str = str . substr ( 0 , str . length - flag . length ) ; } return str ; }
trim the start and end of flag in str.
trim the start and end of flag in str .