请问各位:
    顧客・VIP(Top)
 如何用截取后把它存放到如下文本 
   text1.text=顧客;
  text2.text=VIP;
  text3.text=Top;
谢谢了

解决方案 »

  1.   


    using System.Text.RegularExpressions;
                string str = "顧客・VIP(Top)";
                string patter = @"(\w+)・(\w+)[((](\w+)[))]";
                Match match = Regex.Match(str, patter);
                if (match != null)
                {
                    text1.Text = match.Groups[1].Value;
                    text2.Text = match.Groups[2].Value;
                    text3.Text = match.Groups[3].Value;
                }
      

  2.   

                string str = @"顧客・VIP(Top)";
                Regex reg = new Regex(@"(.*?)・(.*?)(.*?)");
                MatchCollection mc = reg.Matches(str);
                string a = mc[0].Groups[1].ToString();
                string b = mc[0].Groups[2].ToString();
                string c = mc[0].Groups[3].ToString();
      

  3.   

    string str="顧客・VIP(Top)"; text1.text=str.Substring(起始位置, 终止位置);
    text2.text=str.Substring(起始位置, 终止位置);
    text3.text=str.Substring(起始位置, 终止位置);
      

  4.   

                string str = @"顧客・VIP(Top)";
                Regex reg = new Regex(@"(.*?)・(.*?)((.*?))");
                Match match = Regex.Match(str, @"(.*?)・(.*?)((.*?))");
                if (match != null)
                {
                    string a = match.Groups[1].ToString();
                    string b = match.Groups[2].ToString();
                    string c = match.Groups[3].ToString();            }
      

  5.   

    string str = "顧客・VIP(Top)";
               string s1= str.Substring(0, 2);
               textBox1.Text = s1;
              //略
      

  6.   

    string str="顧客・VIP(Top)";char[] ch={'・','(',')'};
    string[] strs=str.split(ch);text1.text=strs[0]; 
    text2.text=strs[1]; 
    text3.text=strs[2] ; 
      

  7.   

    这里发言,表示您接受了CSDN社区的用户行为准则。
      

  8.   

    如果都是lz提供的这样简单的字符串,不要用正则,9楼的方法不错,要注意空格的处理(如果有的话)
    8楼的有点太粗糙,如果字符串长度变了咋办。
    可以用String.IndexOf来获取位置,这个办法应该效率不错。
      

  9.   

    string str = "顧客・VIP(Top)";
                Regex reg = new Regex(@"(.*)・(.*)((.*))");
                Match m = reg.Match(str);            
                MessageBox.Show(m.Groups[1].Value);
                MessageBox.Show(m.Groups[2].Value);
                MessageBox.Show(m.Groups[3].Value);
      

  10.   


            private void SubString()
            {
                string str = "顧客・VIP(Top)";            text1.Text = str.Substring(0, 2);
                text1.Text = str.Substring(3, 3);
                text1.Text = str.Substring(7, 3);         }应该是这样写,5楼的答案是错误的,应该是text1.text=str.Substring(起始位置, 取值长度); 
      

  11.   


            private void SubString()
            {
                string str = "顧客・VIP(Top)";            text1.Text = str.Substring(0, 2);
                text2.Text = str.Substring(3, 3);
                text3.Text = str.Substring(7, 3);         }
    修改了下 楼主可以直接拿去用了
      

  12.   

    substring,split都用过,正则表达式 不是很会,高人们是怎么写的也,请教一下···
      

  13.   

    string testString = "顧客・VIP(Top)";
    //[\u4e00-\u9fa5]是汉字
    //\u30fb是・
    //\(\uff08是(或(
    //\)\uff09是)或)
    Regex r = new Regex(@"(?<Name>[\u4e00-\u9fa5]+)\s*\u30fb\s*(?<Level>\w+)\s*[\(\uff08](?<Site>\w+)[\)\uff09]");
    Match m = r.Match(testString);
    if (m.Success)
    {
    string name = m.Result("${Name}");
    string level = m.Result("${Level}");
    string site = m.Result("${Site}");
    }
      

  14.   

    先判断字符转的长度
      根据长度用substring 截取字符串
      

  15.   

    List <string> kw = new List <string>(Content.Split(new Char[] { ' ', ';','.','~','`','^','/', ',','|', '{', '}', ' <', '>', '[', ']', '(',')','+', '=', '-', '*', ':', '"', '\'', '!', '@', '#', '$', '%','\r','\n'}, StringSplitOptions.RemoveEmptyEntries));  text1.text=kw[0];
       text2.text=kw[1];
      text3.text=kw[2];http://www.mybuffet.cn