string s ="" +(char)34; != Chr(34)还有!= \“等等 [英] string s=""+(char)34; != Chr(34) and also != \" etc.

查看:55
本文介绍了string s ="" +(char)34; != Chr(34)还有!= \“等等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



以下所有都没有正确进行VB.net双引号转换,因为

csharp中的所有以下内容转换为


\而不只是一个双引号:


我试过:


char myDoubleQuote =(char)34;


string myDoubleQuote ="" +(char)34;


string myDoubleQuote =" \"" ;;


myItems ="<?xml版本= QUOT; + myDoubleQuote +" 1.0" + myDoubleQuote +

"?>< users>" &安培; myXml& "< / users>"


我甚至尝试过:

myItems ="<?xml version =<![CDATA [" ;]]> 1.0<![CDATA ["]]>?><用户>" &

myXml& "< / users>"

它不能编译。


我需要字符串myItems才能正确处理在1.0的每一边创建一个

双引号:


myItems =<?xml version =" 1.0"?>< users + myXml +"< / users>


感谢您对此问题的帮助!


None of the following properly do the VB.net double quote conversion because
all of the following in csharp convert to

\" instead of just a double quote: "

I have tried:

char myDoubleQuote = (char)34;

string myDoubleQuote = "" + (char)34;

string myDoubleQuote = "\"";

myItems = "<?xml version=" + myDoubleQuote + "1.0" + myDoubleQuote +
"?><users>" & myXml & "</users>"

I even tried:
myItems = "<?xml version=<![CDATA["]]>1.0<![CDATA["]]>?><users>" &
myXml & "</users>"
it does not compile.


I need the string myItems to be able to properly handle the creation of one
double quote on each side of 1.0 :

myItems = <?xml version="1.0"?><users+ myXml + "</users>

Thank you for your help with this problem!

推荐答案

On Sun,2008年6月15日17:08:34 -0700,xzzy< mr ******** @ comcast.netwrote:
On Sun, 15 Jun 2008 17:08:34 -0700, xzzy <mr********@comcast.netwrote:

[...]

我需要字符串myItems才能正确处理创建

一个

每个双引号1.0的一面:


myItems =<?xml version =" 1.0"?>< users + myXml +"< / users>
[...]
I need the string myItems to be able to properly handle the creation of
one
double quote on each side of 1.0 :

myItems = <?xml version="1.0"?><users+ myXml + "</users>



假设前面的额外双引号< / users>是一个错字,

这应该有效:


string myItems ="<?xml version = \" 1.0 \"?> ;<用户>" + myXml +"< / users>"


不需要箍跳。


如果这不适合你,然后你需要发一个简单但完整的代码示例,这样我们就可以看到你的字符串中还有什么是



Pete

Assuming that the extra double-quote just before "</users>" is a typo,
this should work:

string myItems = "<?xml version=\"1.0\"?><users>" + myXml + "</users>"

No hoop-jumping required.

If that''s not working for you, then you will need to post a
concise-but-complete code sample, so that we can see what else is
happening to your string.

Pete


只有我的意见,Lisp和Double Quotes。 。 。他们俩都应该被带到巷子里,这样他们就可以在院子里死去,而不是死了几英寸。


彼得,谢谢你的时间换句话说,我需要字符串

myItems能够正确处理在1.0的每一边

上创建一个双引号:


最终结果必须是:

<?xml version =" 1.0"?blahblahblah< / users>


给出''myItems''是一个正在构建的字符串,如何生成:<?xml

version =" 1.0"?在csharp中传递给xml


对不起,我没有尽可能地解释,也许用不同的话来说

是对问题的更好理解。

" Peter Duniho" < Np ********* @nnowslpianmk.com在留言中写道

news:op *************** @ petes-computer.local ...

On Sun,2008年6月15日17:08:34 -0700,xzzy< mr ******** @ comcast.netwrote:
only my opinion, Lisp and Double Quotes . . . they both should be taken to
the alley so that instead of dying by inches, they can die by the yard.

Peter, thank you for your time, in different words, I need the string
myItems to be able to properly handle the creation of one double quote on
each side of 1.0 :

The end result must be:
<?xml version="1.0"?blahblahblah</users>

given that ''myItems'' is a string being built, how to generate: <?xml
version="1.0"? in csharp to pass to xml

Sorry I did not explain as well as I could, maybe in different words there
is a better understanding of the problem.
"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
On Sun, 15 Jun 2008 17:08:34 -0700, xzzy <mr********@comcast.netwrote:

[...]

我需要字符串myItems才能正确处理创建

一个

双面引用1.0:


myItems =<?xml version =" 1.0"?>< users + myXml +"< / users>
[...]
I need the string myItems to be able to properly handle the creation of
one
double quote on each side of 1.0 :

myItems = <?xml version="1.0"?><users+ myXml + "</users>



假设前面的额外双引号< / users>是一个错字,

这应该有效:


string myItems ="<?xml version = \" 1.0 \"?> ;<用户>" + myXml +"< / users>"


不需要箍跳。


如果这不适合你,然后你需要发一个简单但完整的代码示例,这样我们就可以看到你的字符串中还有什么是



Pete

Assuming that the extra double-quote just before "</users>" is a typo,
this should work:

string myItems = "<?xml version=\"1.0\"?><users>" + myXml + "</users>"

No hoop-jumping required.

If that''s not working for you, then you will need to post a
concise-but-complete code sample, so that we can see what else is
happening to your string.

Pete


On Sun,2008年6月15日18:09:11 -0700,xzzy< mr ******** @ comcast.netwrote:
On Sun, 15 Jun 2008 18:09:11 -0700, xzzy <mr********@comcast.netwrote:

[...]

彼得,谢谢你的时间,换句话说,我需要字符串

myItems能够正确处理创建一个双重报价

每一边1.0:
[...]
Peter, thank you for your time, in different words, I need the string
myItems to be able to properly handle the creation of one double quote on
each side of 1.0 :



我发布的代码就是这样的。

The code I posted does that.


这篇关于string s =&quot;&quot; +(char)34; != Chr(34)还有!= \“等等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆