16,554
社区成员
发帖
与我相关
我的任务
分享
string a ="D:\Nehops_Saas\Source\Front\Batch\\FRB05000\FRB05000_SV";
a.Split(new string[] { "\" }, StringSplitOptions.None)[5].Split(new string[] { "\\" }, StringSplitOptions.None)[0]
Dim s As String = "D:\Nehops_Saas\Source\Front\Batch\FRB05000\FRB05000_SV"
Dim m As System.Text.RegularExpressions.Match = System.Text.RegularExpressions.Regex.Match(s, "(?n)([^\\]+\\){4}(?<p1>[^\\]+)\\(?<p2>[^\\]+)")
Console.WriteLine(m.Groups(1).Value) 'Batch
Console.WriteLine(m.Groups(2).Value) 'FRB05000