Class DelimitedString
Provides a set of static methods to convert a sequence into a delimited string and break a delimited string into substrings.
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public static class DelimitedString
Methods
| Improve this Doc View SourceCreate<T>(IEnumerable<T>, Action<DelimitedStringOptions<T>>)
Creates a delimited string representation from the specified source
.
Declaration
public static string Create<T>(IEnumerable<T> source, Action<DelimitedStringOptions<T>> setup = null)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | source | The IEnumerable<T> to convert. |
Action<DelimitedStringOptions<T>> | setup | The DelimitedStringOptions<T> which may be configured. |
Returns
Type | Description |
---|---|
String | A String of delimited values that is a result of |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Split(String, Action<DelimitedStringOptions>)
Returns a string[] that contain the substrings of value
delimited by a Delimiter that may be quoted by Qualifier.
Declaration
public static string[] Split(string value, Action<DelimitedStringOptions> setup = null)
Parameters
Type | Name | Description |
---|---|---|
String | value | The value containing substrings and delimiters. |
Action<DelimitedStringOptions> | setup | The DelimitedStringOptions which may be configured. |
Returns
Type | Description |
---|---|
String[] | A string[] that contain the substrings of |
Remarks
This method was inspired by two articles on StackOverflow @ http://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 and https://stackoverflow.com/questions/6542996/how-to-split-csv-whose-columns-may-contain. The default implementation conforms with the RFC-4180 standard.
Exceptions
Type | Condition |
---|---|
InvalidOperationException | An error occurred while splitting |