日期:2014-05-17  浏览次数:20441 次

帮帮忙呀,我得到的字符串是以!@#$%分隔的,有我该怎么分呢
本帖最后由 qiuqingpo 于 2013-07-12 15:50:17 编辑
<img alt="" src="/file/upload/image/20130113/20130113113810_67646.jpg" />!@#$%<img alt="" src="/file/upload/image/20130108/20130108115635_65724.jpg" /> 
....此处省略好多

------解决方案--------------------
 string s="<img alt= src=\"/file/upload/image/20130113/20130113113810_67646.jpg\" />!@#$%<img src=\"/file/upload/image/20130108/20130108115635_65724.jpg\" />" ;
        string[] sArr = s.Split(new string[] { "!@#$%" }, StringSplitOptions.RemoveEmptyEntries);

------解决方案--------------------

string html = "<img alt=\"\" src=\"/file/upload/image/20130113/20130113113810_67646.jpg\" />!@#$%<img alt=\"\" src=\"/file/upload/image/20130108/20130108115635_65724.jpg\" /> ";
        string[] imgs = System.Text.RegularExpressions.Regex.Split(html, System.Text.RegularExpressions.Regex.Escape("!@#$%"));
        foreach (string img in imgs)
        {
            Response.Write(img+"\r\n");
        }

运行下试试。。