CsvUtils
Namespace: Backend.Utils
Assembly: Backend.dll
Provides utility methods for handling CSV data, including escaping fields to prevent CSV Injection and formatting lines.
public static class CsvUtilsInheritance
Show Inherited Members (7)
Methods
Escape(string?)
Escapes a single CSV field to prevent CSV Injection (Formula Injection) and column breakage caused by delimiters or newlines.
public static string Escape(string? value)Parameters
| Name | Type |
|---|---|
| value | string |
Returns
| Type |
|---|
string |
FormatLine(params object?[])
Formats a full CSV line using comma (,) delimiter.
public static string FormatLine(params object?[] fields)Parameters
| Name | Type |
|---|---|
| fields | object |
Returns
| Type |
|---|
string |