Initial Commit

This commit is contained in:
2025-03-25 21:42:32 -04:00
parent c266eecfeb
commit 30c33d3cfd
247 changed files with 60107 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace MarketData.CSVHelper
{
public class StringParser
{
private StringParser()
{
}
public static string[] ParseDelimitedString(string arguments, char delim = ',')
{
var regex = new Regex("(?<=^|,)(\"(?:[^\"]|\"\")*\"|[^,]*)");
List<String> values = new List<String>();
foreach (Match m in regex.Matches(arguments))
{
String value = m.Value;
if (null != value && value.StartsWith("\"") && value.EndsWith("\""))
{
value = value.Substring(1, value.Length - 2);
}
values.Add(value);
}
return values.ToArray();
}
}
}