C#开发过程中经常会用逗号将数组或者列表中的字符串进行连接,这样往往最后会多一个逗号,这个函数用于去除最后的那个逗号,很简单。
/// <summary>
/// 删除最后结尾的一个逗号
/// </summary>
public static string DelLastComma(string str)
{
return str.Substring(0, str.LastIndexOf(","));
}
