String pattern = $"\"{key}\":\"(.*?)\\\"";
MatchCollection matches = Regex.Matches(exec_res, pattern, RegexOptions.IgnoreCase);
if (matches.Count > 0)
{
foreach (Match item in matches)
{
string codestr = item.Groups[1].Value.ToUpper();
}
}
C# json字符串 查询指定的key 值
最新推荐文章于 2024-05-02 20:30:37 发布