bbstr=v.filter(v,"=");//如果有“=”字符//获得一个字符串数组
这个方法怎么样呀..我这样写是错的...?

解决方案 »

  1.   

    if(v.indexOf('=') != -1)
    {
       bbstr = v.split('=');
    }
      

  2.   

    string str = "123=234=345";
    string[] s = str.Split(new char[]{'='});
    /*
    s[0] is 123
    s[1] is 234
    s[2] is 345
    */
      

  3.   

    是根据=号拆分成新数组还是,把=都替换掉?如果拆分,楼上即可,如果替换用 Replace方法
      

  4.   

    我是要获得 字符串数组中  不包含  "="  的 字符串... 
    //可以这样写
    using System.Collections.Generic;
               string[] slist1 = { "11", "33=45", "22", "123=234=345" };//源数组
                 List<string> items = new List<string>();
                foreach (string s in slist1)
                {
                    if (s.IndexOf("=") < 0)//判断
                        items.Add(s);
                }
                string[] slist2 = (string[])items.ToArray();//目标数组
      

  5.   

    我问的主要是.filter()这个方法怎么用..
    别的方法我知道怎么做了..谢谢大家..回贴诚心着都会给分...不过等正确答案出现再结贴..