如何将数据转换为字符串

本文关键字:字符串 转换 数据 | 更新日期: 2023-09-27 18:04:45

如何在单个字符串变量中获取十进制数组值

decimal[] Fld_Frmk_Param3 = { 561568, 223915, 480070, 0, 453, 7.64M, 0 };
string a=???..

如何将数据转换为字符串

应该可以了

decimal[] Fld_Frmk_Param3 = { 561568, 223915, 480070, 0, 453, 7.64M, 0 };
string Result = string.Join(",", Fld_Frmk_Param3);

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);

您可以使用String。连接操作:

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"