• Text of a cell matrix as tab-separated values (TSV) the way Excel and Google Sheets read it: cells separated by a tab, rows by a line break; a cell with a tab, a line break or a quotation mark is put in quotation marks ("…"), a quotation mark inside is doubled. DOM-free.

    Parameters

    • matrix: readonly (readonly string[])[]

      rows of cell texts

    Returns string

    the TSV text (a line break at the end only if the last row is empty)

    Example

    toTsv([["a", "b"], ["1", 'say "hi"']]);   // 'a\tb\n1\t"say ""hi"""'
    

    Since

    1.1.99