如何在单个字符串变量中获取十进制数组值
decimal[] Fld_Frmk_Param3 = { 561568, 223915, 480070, 0, 453, 7.64M, 0 };
string a=???..
答案 0 :(得分:3)
这应该做到
%
答案 1 :(得分:2)
decimal [] Fld_Frmk_Param3 = {561568,223915,480070,0,453,7.64M,0};
StringBuilder sb = new StringBuilder();
foreach (decimal res in Fld_Frmk_Param3)
{
sb.Append(res+",");
}
Console.WriteLine(sb);
答案 2 :(得分:0)
您可以使用String.Join操作:
decimal[] Fld_Frmk_Param3 = { 561568, 223915, 480070, 0, 453, 7.64M, 0 };
string a = String.Join(", ", Fld_Frmk_Param3);
给你:
"561568, 223915, 480070, 0, 453, 7.64M, 0"