111,125
社区成员
发帖
与我相关
我的任务
分享 static string[] GetContent(string strArg)
{
bool isin = false;//是否在引号内
System.Collections.Generic.List<string> result = new System.Collections.Generic.List<string>();//储存各引号里的字符串
string current = string.Empty;
foreach (char cur in strArg)
{
if (cur == '"')
{
if (isin)
{
result.Add(current);
}
else
{
current = string.Empty;
}
isin = !isin;
}
else
{
if (isin)
{
current += cur;
}
}
}
return result.ToArray();
}
private void OutSpecial()
{
string strtmp = "\"strtmp\"";
//MessageBox.Show(strtmp);
string[] strTmps = strtmp.Split('"');
if (strTmps.Length > 1)
{
MessageBox.Show(strTmps[1]);
}
}
(?<=").*(?=")