我有一个字符串
str="Sales Location:
ROAD\nOrder Taker: DAWN RUSHIK Sales Rep: DAWN
RUSHIK\nPhone: (570) 650-0155 Fax: (866) 937-3391
\nEmail: wgr@socantel.net";
如何获取销售代表名称?
Input: Sales Location:
ROAD\nOrder Taker: DAWN RUSHIK Sales Rep: DAWN
RUSHIK\nPhone: (570) 650-0155 Fax: (866) 937-3391
\nEmail: wgr@socantel.net
我想要下面提到的 输出:DAWN RUSHIK
答案 0 :(得分:0)
string pattern = @" Sales Rep:[A-Za-z] + \ s [A-Za-z] +&#34 ;; var result = Regex.Match(str,pattern,RegexOptions.Multiline).ToString()。Split(':')[1]; MessageBox.Show(result.ToString());