有如下数组,要从中取出id:

"[\"3812662409\",\"3812633637\",\"3812627686\",\"3812651467\",\"3812628047\",\"3812650203\"]"

正则匹配可以直接用(\d+),假定上述数组为变量名为input的字符串,C#中可以写作:

List<string> idList = new List<string>();
foreach(Match item in Regex.Matches(input, @"\d+"))
{
    idList.Add(item.Value);
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-16
  • 2022-12-23
  • 2021-09-06
  • 2021-10-25
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-03
  • 2022-12-23
  • 2021-06-26
  • 2022-01-02
  • 2022-03-07
  • 2022-02-15
  • 2022-12-23
相关资源
相似解决方案