有如下數(shù)組,要從中取出id:
"[/"3812662409/",/"3812633637/",/"3812627686/",/"3812651467/",/"3812628047/",/"3812650203/"]"
正則匹配可以直接用(/d+),假定上述數(shù)組為變量名為input的字符串,C#中可以寫作:
List<string> idList = new List<string>();foreach(Match item in Regex.Matches(input, @"/d+")){ idList.Add(item.Value);}
|
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注