<tfoot id='KmP8y'></tfoot>

      <bdo id='KmP8y'></bdo><ul id='KmP8y'></ul>
  1. <legend id='KmP8y'><style id='KmP8y'><dir id='KmP8y'><q id='KmP8y'></q></dir></style></legend>

  2. <i id='KmP8y'><tr id='KmP8y'><dt id='KmP8y'><q id='KmP8y'><span id='KmP8y'><b id='KmP8y'><form id='KmP8y'><ins id='KmP8y'></ins><ul id='KmP8y'></ul><sub id='KmP8y'></sub></form><legend id='KmP8y'></legend><bdo id='KmP8y'><pre id='KmP8y'><center id='KmP8y'></center></pre></bdo></b><th id='KmP8y'></th></span></q></dt></tr></i><div id='KmP8y'><tfoot id='KmP8y'></tfoot><dl id='KmP8y'><fieldset id='KmP8y'></fieldset></dl></div>

      <small id='KmP8y'></small><noframes id='KmP8y'>

    1. 恒定错误中的新行

      时间:2023-06-05
        <tbody id='9BwRw'></tbody>

        <i id='9BwRw'><tr id='9BwRw'><dt id='9BwRw'><q id='9BwRw'><span id='9BwRw'><b id='9BwRw'><form id='9BwRw'><ins id='9BwRw'></ins><ul id='9BwRw'></ul><sub id='9BwRw'></sub></form><legend id='9BwRw'></legend><bdo id='9BwRw'><pre id='9BwRw'><center id='9BwRw'></center></pre></bdo></b><th id='9BwRw'></th></span></q></dt></tr></i><div id='9BwRw'><tfoot id='9BwRw'></tfoot><dl id='9BwRw'><fieldset id='9BwRw'></fieldset></dl></div>
          • <bdo id='9BwRw'></bdo><ul id='9BwRw'></ul>
          • <small id='9BwRw'></small><noframes id='9BwRw'>

          • <tfoot id='9BwRw'></tfoot>

                <legend id='9BwRw'><style id='9BwRw'><dir id='9BwRw'><q id='9BwRw'></q></dir></style></legend>
                本文介绍了恒定错误中的新行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                我正在编写一个 c# 代码,我在其中从数据库中获取值并使用它.我面临的问题如下.

                I am writing a c# code in which i am fetching values from the database and using it. The problem i am facing is as below.

                如果我从数据库中获取的值是:

                If my fetched value from the database is :

                 string cat1 = "sotheby's";
                

                现在在使用这只猫时,我想在单引号之前插入一个转义字符,为此我编写了以下代码:

                now while using this cat i want to insert an escape character before single quote, to achieve this i have written the below code:

                  string cat1 = "sotheby's";
                                    if (cat1.Contains("'")) {
                                        var indexofquote = cat1.IndexOf("'");
                                        cat1.Insert(indexofquote-1,"");
                                        var cat2 = cat1;
                                    }
                

                插入行中的错误上升,反斜杠(转义字符).错误是常量中的新行.请帮助我如何更正此错误.

                The error rises in insert line, the backslash(escape character). The error is New Line in Constant. Please help me how to correct this error.

                推荐答案

                你不能只用 C# 代码编写 "".这将产生常量中的新行"错误,因为它转义"了第二个引号,因此它不计算在内.并且字符串没有关闭.

                You can't just write "" in C# code. That will produce the "New Line in Constant" error because it 'escapes' the second quote so that it doesn't count. And the string isn't closed.

                使用 "\" (自行转义 )
                或使用 @""(逐字字符串).

                Use either "\" (escaping the with itself)
                or use @"" (a verbatim string).

                这篇关于恒定错误中的新行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:SqlCommand INSERT INTO 查询不执行 下一篇:如何将一列插入到两个现有列之间的数据集中?

                相关文章

                最新文章

                  <bdo id='sMWE2'></bdo><ul id='sMWE2'></ul>
              • <tfoot id='sMWE2'></tfoot>
              • <legend id='sMWE2'><style id='sMWE2'><dir id='sMWE2'><q id='sMWE2'></q></dir></style></legend>
                <i id='sMWE2'><tr id='sMWE2'><dt id='sMWE2'><q id='sMWE2'><span id='sMWE2'><b id='sMWE2'><form id='sMWE2'><ins id='sMWE2'></ins><ul id='sMWE2'></ul><sub id='sMWE2'></sub></form><legend id='sMWE2'></legend><bdo id='sMWE2'><pre id='sMWE2'><center id='sMWE2'></center></pre></bdo></b><th id='sMWE2'></th></span></q></dt></tr></i><div id='sMWE2'><tfoot id='sMWE2'></tfoot><dl id='sMWE2'><fieldset id='sMWE2'></fieldset></dl></div>

                  1. <small id='sMWE2'></small><noframes id='sMWE2'>