日期:2014-05-18  浏览次数:20848 次

如何截取如下字符串
sg.department = '54b906d6-5c27-4c06-89c4-0b4a36cd8160' And suppliers = 'ESM Gmbh'And xxx='xys' And sss='abc' ...

这里只去sg.department = '54b906d6-5c27-4c06-89c4-0b4a36cd8160' 里的54b906d6-5c27-4c06-89c4-0b4a36cd8160

谢谢!

------解决方案--------------------
用Split 单引号 来分隔这个字符串
然后取第二段
嘿嘿
------解决方案--------------------
C# code

            string s = "sg.department = '54b906d6-5c27-4c06-89c4-0b4a36cd8160";
            Regex reg = new Regex(@"\S*\s*=");
            Match m = reg.Match(s);
            MessageBox.Show(m.Value);

------解决方案--------------------
Replace("'54b906d6-5c27-4c06-89c4-0b4a36cd8160", "")
------解决方案--------------------
Regex.Matches()更适合
------解决方案--------------------
探讨

Replace("'54b906d6-5c27-4c06-89c4-0b4a36cd8160", "")