Skip to content

926d5554 5649 9346 d568 ae2ad0909232

Axel Kesseler edited this page Aug 16, 2024 · 4 revisions

ProcessHelper.ConvertToOutput Method

This method converts given value into its output representation.

Namespace: Plexdata.CsvParser.Internals
Assembly: Plexdata.CsvParser.NET (in Plexdata.CsvParser.NET.dll) Version: 1.1.3+d5bef99aa35461ce4bafadf0bf2c2aeca18044ea

Syntax

C#

public static string ConvertToOutput(
	string value,
	char separator,
	bool quoting
)

Parameters

 

value
Type: System.String
The value string to be transformed.
separator
Type: System.Char
The separator to be applied at the end.
quoting
Type: System.Boolean
The flag that indicates whether double-quotes have to be applied.

Return Value

Type: String
A string for the value ready to put it into the CSV output.

Remarks

Keep in mind, the result string is enclosed in double-quotes either if quoting is true or the given value contains at least one of the control character.

Control character means in this context that the value contains either a carriage return, or a line feed, or a double-quote, or most important the separator character itself.

Additionally note that not only string could be enclosed by double-quotes. Because it could be possible as well that number types will be surrounded by double-quotes. This would be for example the case when a comma separator is used and the given culture is German.

Finally, any of possibly existing string delimiters are replaced by two double-quotes automatically. This in turn represents the escaping of double-quotes according to RFC 4180.

See Also

Reference

ProcessHelper Class
Plexdata.CsvParser.Internals Namespace

Clone this wiki locally