或者判断一下info啊。
如果为空:info=CheckBoxList1.Items[i].Value
否则    :info+="," + CheckBoxList1.Items[i].Value

解决方案 »

  1.   

    最简单的就是这样了
    info=info.substring(0,info.length-1)
      

  2.   

    using System;class test{
    public static void Main(){
    string a="etsat,testsa,test,asttest,testse,testest,";
    Console.Write(a.Trim(",".ToCharArray()));
    }
    }
      

  3.   

    if (info.IndexOf(',') != -1)
    {
       info.Remove(info.Length-1);
    }
      

  4.   

    info = info.TrimEnd(',');
    这个才是最简单的。
      

  5.   

    info = info.TrimEnd(',');
    这个不错,最简单
      

  6.   

    info = info.TrimEnd(',');
      

  7.   

    if (CheckBoxList1.Items[i].Selected)
    {
        if(inof == "")
          {
             info += CheckBoxList1.Items[i].Value;
          }
        else
         {
             info += "," + CheckBoxList1.Items[i].Value;
         }
    }
      

  8.   

    if( info != ""  )
    {
        info = info.subString(0, info.Length-1)
    }
      

  9.   

    /// <summary>
    /// 去掉字串最后一个字符(如果是分隔符) 
    /// </summary>
    /// <param name="str"></param>
    /// <param name="compChar"></param>
    /// <returns></returns>
    public static string SubStringLastChar(string str, char compChar)
    {
    if ((str.Length > 0) && (str[str.Length - 1] == compChar))
    {
    str = str.Remove(str.Length - 1, 1);
    }
    return str;
    }
      

  10.   

    info = info.TrimEnd(',');
    挖卡卡