整理代码
This commit is contained in:
@@ -12,11 +12,9 @@ public static partial class DumpDataHelper
|
||||
private static partial Regex MatchBrackets();
|
||||
|
||||
|
||||
public static async Task<string[]> GetCsvHeadersFromSqlFileAsync(string txt)
|
||||
public static string[] GetCsvHeadersFromSqlFileAsync(string txt)
|
||||
{
|
||||
//var txt = await File.ReadAllTextAsync(filePath);
|
||||
var match = MatchBrackets().Match(txt);
|
||||
|
||||
return ParseHeader(match.ValueSpan);
|
||||
}
|
||||
|
||||
@@ -60,9 +58,8 @@ public static partial class DumpDataHelper
|
||||
return filePath[(firstDotIdx+1)..secondDotIdx].ToString();
|
||||
}
|
||||
|
||||
public static async Task<string[]> GetCsvFileNamesFromSqlFileAsync(string txt,Regex regex)
|
||||
public static string[] GetCsvFileNamesFromSqlFileAsync(string txt,Regex regex)
|
||||
{
|
||||
//var txt = await File.ReadAllTextAsync(filePath);
|
||||
var matches = regex.Matches(txt);
|
||||
return matches.Select(match => match.ValueSpan[1..^1].ToString()).ToArray();
|
||||
}
|
||||
|
Reference in New Issue
Block a user