wasSharp

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 4  →  ?path2? @ 3
/CSV.cs
@@ -25,12 +25,11 @@
public static string wasEnumerableToCSV(IEnumerable<string> l)
{
string[] csv = l.Select(o => o).ToArray();
char[] escapeCharacters = {'"', ' ', ',', '\r', '\n'};
Parallel.ForEach(csv.Select((v, i) => new {i, v}), o =>
{
string cell = o.v.Replace("\"", "\"\"");
 
switch (cell.IndexOfAny(escapeCharacters))
switch (cell.IndexOfAny(new[] {'"', ' ', ',', '\r', '\n'}))
{
case -1:
csv[o.i] = cell;