An array of Image Url path:
["http://cdncms.fonts.net/hero-images/FEX_Hero_Thumb.png ","http://cdncms.fonts.net/hero-images/Wilma_Hero_Thumb.png "]
asp.net mvc Controller :
public ActionResult Extract(string[] name)
{
//List<string> myList = name.ToList<string>();
for(int x = 0; x < name.Length; x++)
{
//string something = name[x];
var item = name[x];
Session["values"] = item;
}
char[] delimiter1 = new char[] { ',' }; // <-- Split on these
string[] array1 = Session["values"].ToString().Split(delimiter1, StringSplitOptions.RemoveEmptyEntries);
foreach (var item in array1)
{
string exts = Path.GetExtension(item); //illegal character
string strRealname = Path.GetFileName(item); illegal character
}
我知道这个问题是由于 [ 开头和最后一个字符的存在。我尝试过但没有成功。知道如何在 C# 中使用 split 函数删除它