将数组转成字符串
/// <summary>
/// 将数组转成字符串
/// </summary>
/// <param name="glue">分隔符</param>
/// <param name="pieces">要字符串数组</param>
private string Implode(char glue,string[] pieces)
{
string result = string.Empty;
int count = pieces.Length;
for (int i = 0; i < count;i++ )
{
if(i==0){
result = pieces[i];
}else{
result = result + glue.ToString() + pieces[i];
}
}
return result;
}
时间: 2024-10-17 12:50:08