string Style = "_";
char[] t  = new Char[] {Style};
string[] StrS = str1.Split(t);
string res = StrS[StrS.Length-1].ToString();无法将类型“string”隐式转换为“char”怎么解决这个问题呢?

解决方案 »

  1.   

    string Style = "_";
    char[] t  = new Char[] {Style};
    string[] StrS = str1.Split(t);
    string res = StrS[StrS.Length-1].ToString();========================================
    char Style = '_';
    char[] t  = new Char[] {Style};
    string[] StrS = str1.Split(t);
    string res = StrS[StrS.Length-1].ToString();你在char数组里赋string类型的值当然不行了
    但你上面的代码,换来换去,不知道你代码起什么作用 :)
    ==============myblog=================
    http://cache.monocn.com
    =====================================
      

  2.   

    char[] t = Style.ToCharArray();
      

  3.   

    string[] StrS = str1.Split('_');
    string res = StrS[StrS.Length-1].ToString();
      

  4.   

    char[] t = Style.ToCharArray();