日期:2014-05-20  浏览次数:20880 次

匹配字串 公交2路_上_100.gif 如何提取由2个下划线分割的3部分
匹配字串 公交2路_上_100.gif 如何提取由2个下划线分割的3部分

------解决方案--------------------
使用string.Split(XX,XX)
MSND去
------解决方案--------------------
try...

C# code
            string test = "公交2路_上_100.gif";
            string[] result = test.Split(new char[] { '_' });
            foreach (string s in result)
            {
                richTextBox2.Text += s + "\n";
            }

------解决方案--------------------
string.Split('_')
------解决方案--------------------
YourStr.Split(new char[] { '_' });