Click here to Skip to main content
15,884,836 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to assign this
""dateTimeConnect","dateTimeDisconnect","lastRedirectDn","pkid","originalCalledPartyNumberPartition","callingPartyNumberPartition""

to a string in c# ?
Posted

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


C#
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
 
Share this answer
 
Comments
Yesudasan Moses 21-Aug-13 6:28am    
+5 :)
kishore sharma 21-Aug-13 8:23am    
Thanks
Jitendra Sabat 21-Aug-13 7:59am    
Nice answer.
kishore sharma 21-Aug-13 8:23am    
Thanks
Use escape sequence \ before every innerquotes...

C#
string str = 
"\"dateTimeConnect\",\"dateTimeDisconnect\",\"lastRedirectDn\",\"pkid\",\"originalCalledPartyNumberPartition\",\"callingPartyNumberPartition\"";
 
Share this answer
 
v2
Comments
kishore sharma 21-Aug-13 6:23am    
my 5
Yesudasan Moses 21-Aug-13 6:28am    
thanks kishore.. :)
Hi Keerthi,

Try this,

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


I hope this will help you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900