public static extractIntParamFromJson ( string keyName, string json ) : int | ||
keyName | string | |
json | string | |
return | int |
public static int extractIntParamFromJson(string keyName, string json)
{
string regex = string.Format("\"{0}\":\\s?(\\d+)", keyName);
Match match = Regex.Match(json, regex);
int keyValue = Convert.ToInt32(match.Groups[1].Value);
return keyValue;
}