| | |
| | | }
|
| | |
|
| | | //{'17':['63','6','27'],'65':['800'],'55':['139'],'19':['1000','2600','130']}
|
| | | public static Regex userDataRegex = new Regex(@"'([0-9]+)':\[(.*?)\]", RegexOptions.Singleline);
|
| | | public static Dictionary<int, List<int>> Analysis(string val)//正则表达式的字符串分割
|
| | | {
|
| | | string s = ServerStringTrim(val);
|
| | |
| | | //}
|
| | | }
|
| | |
|
| | | public static Dictionary<int, List<int>> ParseJsonDict(string jsonStr)
|
| | | {
|
| | | if (jsonStr == "{}" || string.IsNullOrEmpty(jsonStr))
|
| | | {
|
| | | return new Dictionary<int, List<int>>();
|
| | | }
|
| | | var dict = JsonMapper.ToObject<Dictionary<string, List<int>>>(jsonStr);
|
| | | Dictionary<int, List<int>> result = new Dictionary<int, List<int>>();
|
| | |
|
| | | foreach (var item in dict)
|
| | | {
|
| | | result[int.Parse(item.Key)] = item.Value;
|
| | | }
|
| | |
|
| | | return result;
|
| | | }
|
| | |
|
| | | //json格式: {"1":1}
|
| | | public static Dictionary<int, int> ParseIntDict(string jsonStr)
|
| | | {
|
| | | if (jsonStr == "{}" || string.IsNullOrEmpty(jsonStr))
|
| | |
| | | return result;
|
| | | }
|
| | |
|
| | | //json格式: {"1":[1,2],"2":[3,4]}
|
| | | public static Dictionary<int, int[]> ParseIntArrayDict(string jsonStr)
|
| | | {
|
| | | if (jsonStr == "{}" || string.IsNullOrEmpty(jsonStr))
|
| | |
| | | return result;
|
| | | }
|
| | |
|
| | | //json格式: {"1":[[1,2],[3,4]]}
|
| | | public static Dictionary<int, int[][]> ParseIntArray2Dict(string jsonStr)
|
| | | {
|
| | | if (jsonStr == "{}" || string.IsNullOrEmpty(jsonStr))
|