Detailed Method Reference

Namespace: Canley.Utility.CSV
Class: CanleyCSVReader

GetHeaderIndex

public int GetHeaderIndex(string headerName)
  • Description: Scans the first row (the header) for a matching string. Case-insensitive.

  • Workflow:

    1. Targeting: Targets Row 0 of the internal grid.
    2. Comparison: Performs a case-insensitive string comparison across all columns in that row.
    3. Result: Returns the index of the first match found, or -1 if the header does not exist.
  • Parameters:

    • headerName: The name of the column to search for.
  • Returns: int (The column index, or -1 if not found).

  • Example:

int scoreCol = reader.GetHeaderIndex("Highscore");