28,391
社区成员
发帖
与我相关
我的任务
分享
string str = "999-赵五|1-张三|0-day";
Regex reg=new Regex(@"\|?(\w+)\-([^\|]+)\|?");
MatchCollection mac= reg.Matches(str);
if (mac.Count > 2)
{
string ss = mac[mac.Count - 2].Groups[2].Value;
}
string str = "999-赵五|1-张三|0-day";
Regex reg=new Regex(@"\|?(\w+)\-([^\|]+)\|?");
MatchCollection mac= reg.Matches(str);
if (mac.Count > 2)
{
string ss = mac[mac.Count - 2].Groups[2].Value;
}