Class WorksheetNameSanitizer
Namespace: TecnoPack.TranslationsManager.Excel
Assembly: CO0002_Templ_FlowpackHMI_V00_26_M.dll
Sanitizes and generates unique worksheet names for Excel.
public static class WorksheetNameSanitizer
Inheritance
object ← WorksheetNameSanitizer
Methods
MakeUnique(XLWorkbook, string)
Generates a unique name in the workbook.
public static string MakeUnique(XLWorkbook workbook, string baseName)
Parameters
workbook XLWorkbook
Workbook to check against.
baseName string
The base name.
Returns
string
A unique, sanitized worksheet name.
MakeUnique(Func<string, bool>, string)
Generates a unique name in the workbook.
public static string MakeUnique(Func<string, bool> worksheetExits, string baseName)
Parameters
worksheetExits Func<string, bool>
A function that returns if a worksheet with a specific name already exists
baseName string
The base name.
Returns
string
A unique, sanitized worksheet name.
Sanitize(string)
Cleans a base name to make it Excel-compliant.
public static string Sanitize(string baseName)
Parameters
baseName string
Original name.
Returns
string
Sanitized name (≤31 chars, invalid chars removed).