loadFromString method

void loadFromString(
  1. String csvData
)

Clears the current contents and loads the CSV text contained in csvData. Set HasColumnNames, Delimiter, EnableQuotes, and other parsing options before calling this method.

Passing an empty string successfully clears the CSV. The parser is permissive; for example, an unterminated quoted field extends through the end of csvData rather than necessarily causing the load to fail.

Throws a ChilkatException if the call fails; the details are in ChilkatException.lastErrorText. Throws an ArgumentError if a string argument contains a NUL character.

Implementation

void loadFromString(String csvData) {
  final h = _handle;
  using((arena) {
    final r = _CkCsv_LoadFromString(h, _toNative(arena, csvData, 'csvData'));
    if (r == 0) {
      throw _fail('loadFromString');
    }
  });
}