我有这个看起来像这个
的字符串string postData = "event_MemberGUID2=&event_EventID2=6888591&event_ItemID=10151249&event_ItemType=&event_ItemStatusDate=7%2F19%2F2017&event_ItemSemTopic=Test Seminar Topic&event_ItemSemType=100&event_ItemRegion=101A&event_ItemSemPointValue=0&event_ItemStartDate=06%2F05%2F2017&event_ItemEndDate=06%2F05%2F2017&event_ItemStatusID=3";
我试图获取event_ItemID
这就是我能够得到它的方式
List<string> lst = new List<string>();
List<string> lstB = new List<string>();
lst = postData.Split('&').ToList();
foreach(var a in lst)
{
if (a.Contains("ItemID"))
{
lstB = a.Split('=').ToList();
Console.WriteLine(lstB[1]);
}
}
但获取event_ItemID是否比我提取它更简单,更优雅?