我有string以下格式。
string instance = "{112,This is the first day 23/12/2009},{132,This is the second day 24/12/2009}"
private void parsestring(string input)
{
string[] tokens = input.Split(','); // I thought this would split on the , seperating the {}
foreach (string item in tokens) // but that doesn't seem to be what it is doing
{
Console.WriteLine(item);
}
}
Run Code Online (Sandbox Code Playgroud)
我期望的输出应如下所示:
112,This is the first day 23/12/2009
132,This is the second day 24/12/2009
Run Code Online (Sandbox Code Playgroud)
但是目前,我得到以下内容:
{112
This is the first day 23/12/2009
{132 …Run Code Online (Sandbox Code Playgroud)