Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/269.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 字符串格式难题_C# - Fatal编程技术网

C# 字符串格式难题

C# 字符串格式难题,c#,C#,对于我来说,以下简单的string.format()不起作用 return string.format(Resources.ABCSTRING, fieldName, fieldType); resources.ABCSTRING在哪里 {1} _{0}; internal {1} {0} { get { return _{0}; } set { _{0} = value;

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

return string.format(Resources.ABCSTRING, fieldName, fieldType);
resources.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};
internal {1} {0}
{{
    get {{ return _{0}; }}
    set
    {{
        _{0} = value;
        UpdateRowValue(myObj, "{0}", value);
    }}

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

你忘了避开独立的大括号

你需要把它改成

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

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