Table of Contents

SplitDelimited Method

Definition

Namespace
Cuemon.Extensions
Assemblies
Cuemon.Extensions.Core.dll
Source
src/Cuemon.Extensions.Core/StringExtensions.cs

SplitDelimited(string, Action<DelimitedStringOptions>)

Returns a string array that contain the substrings of value delimited by a Delimiter that may be quoted by Qualifier.

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

Parameters

value string

The string to extend.

setup Action<DelimitedStringOptions>

The DelimitedStringOptions which may be configured.

Returns

string[]

A string array that contain the substrings of value delimited by a Delimiter and optionally surrounded within Qualifier.

Remarks

This method was inspired by two articles on StackOverflow @ http://stackoverflow.com/questions/2807536/split-string-in-c-sharp and https://stackoverflow.com/questions/3776458/split-a-comma-separated-string-with-both-quoted-and-unquoted-strings. The default implementation conforms with the RFC-4180 standard.

Exceptions

InvalidOperationException

An error occurred while splitting value into substrings separated by Delimiter and quoted with Qualifier. This is typically related to data corruption, eg. a field has not been properly closed with the Qualifier specified.