hive/html/js/basic.js
// Quotes one string value for CSV, but only if necessary
Quotes one string value for CSV, but only if necessary
Quotes one string value for CSV but only if necessary
function quoteForCSV(string)
{
    if (string === undefined || string === null)
        string = "";
    else if (typeof(string) !== "string")
        string += "";
    if (/[,"\r\n]/.test(string)) {
        string = string.replace(/"/g, '""');
        string = '"' + string + '"';
    }
    return string;
}
function quoteForCSV ( string ) { if ( string === undefined || string === null ) string = "" ; else if ( typeof ( string ) !== "string" ) string += "" ; if ( / [,"\r\n] / . test ( string ) ) { string = string . replace ( / " / g , '""' ) ; string = '"' + string + '"' ; } return string ; }
Quotes one string value for CSV, but only if necessary
Quotes one string value for CSV but only if necessary