如何构建双引号字符串 [英] how to build a double quoted string

查看:81
本文介绍了如何构建双引号字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何分配这个

dateTimeConnect,dateTimeDisconnect,lastRedirectDn,pkid,originalCalledPartyNumberPartition,callingPartyNumberPartition



到c#中的字符串?

how to assign this
""dateTimeConnect","dateTimeDisconnect","lastRedirectDn","pkid","originalCalledPartyNumberPartition","callingPartyNumberPartition""

to a string in c# ?

推荐答案

为此你需要在google中搜索关键字

转义序列对于双引号

我可以用你的例子向你解释你可以根据需要进行更改



考虑我需要字符串as =>我的朋友告诉迟到总比没有好

所以现在把这个字符串添加到变量





For this you need to seach in google with keyword
"escape sequence for double quotes"
I can explain you with example you can make changes as per your need

Consider i need string as => My friend told "being late is better than never"
so now to add this string to variable


string str =  "My friend told" +"\"being late is better than never\"";

StringBuffer strBuf = new StringBuffer();

strBuf.Append(str);



其中\用于转义下一个字符。



希望这可以帮助你

干杯


Where \ is used to escape the next character to it.

Hope this helps you
Cheers


在每个内部引用之前使用转义序列\ ...



Use escape sequence \ before every innerquotes...

string str = 
"\"dateTimeConnect\",\"dateTimeDisconnect\",\"lastRedirectDn\",\"pkid\",\"originalCalledPartyNumberPartition\",\"callingPartyNumberPartition\"";


Hi Keerthi,



试试这个,



Hi Keert

Try this,

string str = "\"dateTimeConnect" + "\"," + "\"dateTimeDisconnect" + "\"," + "\"lastRedirectDn" + "\"," + "\"pkid" + "\"," + "\"originalCalledPartyNumberPartition" + "\"," + "\"callin\"";





我希望这会对你有帮助。



I hope this will help you.


这篇关于如何构建双引号字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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