AssemblyCSharp.StringUtils.SplitQuotedLine C# (CSharp) Метод

SplitQuotedLine() публичный статический Метод

public static SplitQuotedLine ( this value, char separator, bool quotes ) : string
value this
separator char
quotes bool
Результат string
        public static string SplitQuotedLine(this string value, char separator, bool quotes)
        {
            // Use the "quotes" bool if you need to keep/strip the quotes or something...
            var s = new StringBuilder();
            var regex = new Regex("(?<=^|,)(\"(?:[^\"]|\"\")*\"|[^,]*)");
            foreach (Match m in regex.Matches(value))
            {
            s.Append(m.Value);
            }
            return s.ToString();
        }