string.format难题

时间:2010-02-02 02:53:11

标签: c#

对我来说,以下简单的string.format()不起作用!!

return string.format(Resources.ABCSTRING, fieldName, fieldType);

其中Resouces.ABCSTRING是

    {1} _{0};
    internal {1} {0}
    {
        get { return _{0}; }
        set
        {
            _{0} = value;
            UpdateRowValue(myObj, "{0}", value);
        }

    }
    internal void SetNull{0}()
    {
        UpdateRowValue(myObj, "{0}", DBNull.Value);
    }

这显然是基本的东西,但我没有看到它!有什么帮助吗?

1 个答案:

答案 0 :(得分:9)

你忘了逃避独立牙箍。

您需要将其更改为

{1} _{0};
internal {1} {0}
{{
    get {{ return _{0}; }}
    set
    {{
        _{0} = value;
        UpdateRowValue(myObj, "{0}", value);
    }}

}}
internal void SetNull{0}()
{{
    UpdateRowValue(myObj, "{0}", DBNull.Value);
}}
相关问题