public static void WriteCsvExcelValue(this TextWriter writer, string value) { if (writer is null) { throw new NullReferenceException(); } Contract.EndContractBlock(); CsvWriter.WriteValue(writer, '=' + CsvUtility.WrapQuotes(value)); }
public static void WriteCsvExcelHyperlink(this TextWriter writer, string link, string?text = null) { if (writer is null) { throw new NullReferenceException(); } Contract.EndContractBlock(); WriteCsvExcelValue(writer, $"=HYPERLINK({CsvUtility.WrapQuotes(link)}{(text is null ? string.Empty : (',' + CsvUtility.WrapQuotes(text)))})"); }