Use of Doublequotes in a string... but it doesnt work?
-
Hi. I tried all known solutions and now im turning to you. I cant get the " in the string. Tried with: \", @ "", """, Character converting, string converting, ... The only solution i see, is to create a label, which would be hiddent, but would contain text = ". I could borrow its text and use it in the code... but thats not it i'm afraid. string xc = "Deklica je po " +Convert.ToChar(34)+ " Vodo šla."; The result i get, by using any of know solutions is the same for anything : Result = \" String returns this.
Regards, Matjaž
-
Hi. I tried all known solutions and now im turning to you. I cant get the " in the string. Tried with: \", @ "", """, Character converting, string converting, ... The only solution i see, is to create a label, which would be hiddent, but would contain text = ". I could borrow its text and use it in the code... but thats not it i'm afraid. string xc = "Deklica je po " +Convert.ToChar(34)+ " Vodo šla."; The result i get, by using any of know solutions is the same for anything : Result = \" String returns this.
Regards, Matjaž
-
Hi Matjaz, The following line of code will insert a double quote in your string value. string xc = "Deklica je po \" Vodo šla."; Hope this helps...
won't work. i get output: Deklica je po \" Vodo šla. don't know why backslash in text.
Regards, Matjaž
-
won't work. i get output: Deklica je po \" Vodo šla. don't know why backslash in text.
Regards, Matjaž
When you say output, you mean the watch window of the debugger..? The watch window of the debugger always shows the backslash before the double quote as an escape character but it will not display in your actual results. Try this by setting a label or textbox's text to the string value. You will see that there isnt a backslash in the text. Hope this helps...
-
When you say output, you mean the watch window of the debugger..? The watch window of the debugger always shows the backslash before the double quote as an escape character but it will not display in your actual results. Try this by setting a label or textbox's text to the string value. You will see that there isnt a backslash in the text. Hope this helps...
Yes, that helps a lot :) I was debugging and i was always getting the backslash and just a minute before your answer, i tried the same sentence with a label - and it worked, like you said. Thanks!
Regards, Matjaž