110,538
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string str = @"[{Name:\\u4e2d\\u56fd,IdNo:a,\""BirthDt\"":\""1990-10-10\"",\""Leader\"":0,\""ResOnly\"":0,\""Mail\"":\""aa@a.com\"",\""Tel\"":\""010888888\"",\""Bnfs\"":\""ss\""}]";
str = str.Replace("[", "");
str = str.Replace("}", "");
str = str.Replace("]", "");
str = str.Replace("{", "");
str = str.Replace(@"\""", "");
string[] s = str.Split(',');
foreach (string ss in s)
{
Console.WriteLine(ss.Replace (@"\\","\\"));
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string str = @"[{Name:\\u4e2d\\u56fd,IdNo:a,\""BirthDt\"":\""1990-10-10\"",\""Leader\"":0,\""ResOnly\"":0,\""Mail\"":\""aa@a.com\"",\""Tel\"":\""010888888\"",\""Bnfs\"":\""ss\""}]";
Regex re = new Regex(@"({|""|,)(?<key>[^,}]*)");
MatchCollection mc = re.Matches(str);
foreach (Match m in mc)
Console.WriteLine(m.Groups["key"].Value.Replace (@"\""","").Replace(@"\\","\\")); }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string str = @"[{Name:\\u4e2d\\u56fd,IdNo:a,\""BirthDt\"":\""1990-10-10\"",\""Leader\"":0,\""ResOnly\"":0,\""Mail\"":\""aa@a.com\"",\""Tel\"":\""010888888\"",\""Bnfs\"":\""ss\""}]";
Regex re = new Regex(@"({|""|,)(?<key>[^,}]*)");
MatchCollection mc = re.Matches(str);
foreach (Match m in mc)
Console.WriteLine(m.Groups["key"].Value.Replace (@"\""",""));
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string str = @"[{Name:\\u4e2d\\u56fd,IdNo:a,\""BirthDt\"":\""1990-10-10\"",\""Leader\"":0,\""ResOnly\"":0,\""Mail\"":\""aa@a.com\"",\""Tel\"":\""010888888\"",\""Bnfs\"":\""ss\""}]";
str=str.Replace("[","");
str = str.Replace("}", "");
str = str.Replace("]", "");
str = str.Replace("{", "");
str = str.Replace(@"\""", "");
string[] s = str.Split(',');
foreach (string ss in s)
{
Console.WriteLine(ss);
}
}
}
}