if (clientInfo.cf.geo_region != null)
{
List<string> geoListRegion = clientInfo.cf.geo_region.Split(new string[] { ",", ", " }, StringSplitOptions.RemoveEmptyEntries).ToList();
rs_product_hit = rs_product_hit.Where(ph => geoListRegion.Contains(ph.region));
}
我希望能夠輸入「AMAC,南美洲」或「AMAC,南美洲」,並在逗號之後放置/未放置空格。不幸的是,我的輸出結果只是在沒有空格的情況下分割逗號,如果輸入是「AMAC,南美洲」,則輸出正確的輸出。我可以做些什麼來獲得相同的結果,在逗號之後是否有空格?將字符串分割爲多個字符