Table of Contents

Split Method

Definition

Namespace
Cuemon
Assemblies
Cuemon.Core.dll
Source
src/Cuemon.Core/DelimitedString.cs

Split(string, Action<DelimitedStringOptions>)

Splits the specified value into substrings by using the configured Delimiter and Qualifier.

public static string[] Split(string value, Action<DelimitedStringOptions> setup = null)

Parameters

value string

The delimited string to split.

setup Action<DelimitedStringOptions>

The DelimitedStringOptions which may be configured.

Returns

string[]

An array of string values that contains the substrings extracted from value.

Remarks

The default implementation conforms to RFC 4180.

This implementation was inspired by the following Stack Overflow discussions:

  • https://stackoverflow.com/questions/2807536/split-string-in-c-sharp
  • https://stackoverflow.com/questions/3776458/split-a-comma-separated-string-with-both-quoted-and-unquoted-strings
  • https://stackoverflow.com/questions/6542996/how-to-split-csv-whose-columns-may-contain

Exceptions

ArgumentException

value is null, empty, or consists only of white-space characters.

InvalidOperationException

Thrown when value cannot be split using the configured Delimiter and Qualifier. This typically indicates malformed input, such as an unclosed qualified field.