Detailed Method Reference

Namespace: Canley.Utility.CSV
Class: CanleyCSVReader

GetCell

public string GetCell(int row, int col)
  • Description: The safest way to access data. If the requested row or column is outside the bounds of the actual data, it returns an empty string rather than throwing an error.

  • Workflow:

    1. Bounds Checking: Validates the provided row index against the total row count and the column index against the specific row length.
    2. Value Retrieval: Returns the string content if indices are valid; otherwise, defaults to string.Empty.
  • Parameters:

    • row: The zero-based index of the row.
    • col: The zero-based index of the column.
  • Returns: string (The cell content or string.Empty).

  • Example:

string val = reader.GetCell(1, 0); // Row 1, Col 0