string str= "12,asdfl,89,90,";
str = str.substring(0,str.Length-1) +" ";

解决方案 »

  1.   

    1、首先使用Length算出长度!
    2、利用Remove移除最后一个字符!(具体参看MSDN)
      

  2.   

    veaven(风林火山)的方法应该是可以的,当然也可以用stringbuilder str = "12,asdfl,89,90,";然后好像有个replace吧,替换一下就可以了
      

  3.   

    去看帮助里的string类的各个成员!
      

  4.   

    string str="12,asdfl,89,90,";
    str=str.Substring(0,str.LastIndexOf(",")-1);
      

  5.   

    if (str.Length > 0 && str[str.Length - 1] == ',') {
         str = str.Substring(0, str.Length - 1);
    }
      

  6.   

    veaven(风林火山) ( ) 信誉:100 
    string str= "12,asdfl,89,90,";
    str = str.substring(0,str.Length-1) +" ";这位仁兄的不能满足楼主的需求?
      

  7.   

    string str= "12,asdfl,89,90,";
    str = str.Remove(str.Length-1,1);