473,394 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

String with double quotes includes

Jac
Hi

string code = "05"
string str

I want the string str as follows = "05" in that case the double quotes makes part of the sting

I tried as follows
str= "\"" + code + "\""

I receive following (when I stand on str) --> "\"05\"

I tried also
str = @"""" + code + @""""

I receive following (when I stand on str) --> "\"05\"

How I can slove this
Thx
Ja

Nov 15 '05 #1
3 5741
Da
what you have looks good, so i tried it out on my pc, and it worked fine

both of the bellow will result in a string of "05
1. code = "\"05\""
o
2. code = "05"; str = "\"" + code + "\""

--Da

----- Jac wrote: ----

Hi

string code = "05"
string str

I want the string str as follows = "05" in that case the double quotes makes part of the sting

I tried as follows
str= "\"" + code + "\""

I receive following (when I stand on str) --> "\"05\"
I tried also
str = @"""" + code + @""""

I receive following (when I stand on str) --> "\"05\"

How I can slove this
Thx
Ja

Nov 15 '05 #2
"Jac" <an*******@discussions.microsoft.com> wrote in message
news:86**********************************@microsof t.com...
string code = "05";
string str;

I want the string str as follows = "05" in that case the double quotes makes part of the sting.
I tried as follows :
str= "\"" + code + "\"";

I receive following (when I stand on str) --> "\"05\""


I am not sure what you are looking at when you "stand on str" but it seems
okay to me, the debugger may give you the wrong yet accurate impression. If
you would print the string you would see "05" just as you intend it to be.

Martin.
Nov 15 '05 #3
Visual Studio.NET will display the escape sequence for characters that
require them in order to include them in strings, in many of its
debugger-related windows and tooltips. This might be confusing you. Quote
marks are one of those characters.

If you print out the values, you should see the strings you are expecting.

Hope this helps.
--
Jeffrey Wynn
so********@nospam.net

"Jac" <an*******@discussions.microsoft.com> wrote in message
news:86**********************************@microsof t.com...
Hi,

string code = "05";
string str;

I want the string str as follows = "05" in that case the double quotes makes part of the sting.
I tried as follows :
str= "\"" + code + "\"";

I receive following (when I stand on str) --> "\"05\""
I tried also :
str = @"""" + code + @"""";

I receive following (when I stand on str) --> "\"05\""

How I can slove this?
Thx,
Jac

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Ann Marinas | last post by:
Happy New Year to all! :D I am currently developoing an application that imports data from a CSV file. Each comma represents an array item that I need to extract data with. My problem is...
12
by: Jeff S | last post by:
In a VB.NET code behind module, I build a string for a link that points to a JavaScript function. The two lines of code below show what is relevant. PopupLink = "javascript:PopUpWindow(" &...
6
by: tshad | last post by:
In my User control, I tried to do this: *************************************************************************** <Script runat="server"> Public ClientName As String = "<!-- #include file =...
1
by: Mark Rae | last post by:
Hi folks, Apologies - am having a bit of a "senior moment"... Is there a way to convert a string containing escaped characters into a verbatim string literal? I.e. converting something like...
16
by: Charles Law | last post by:
I have a string similar to the following: " MyString 40 "Hello world" all " It contains white space that may be spaces or tabs, or a combination, and I want to produce an array...
5
by: sridev | last post by:
hi all, i have a xml file.I have converted the xml file to String using OuterXml....... now i am getting like this "<ClientList><Client...
2
by: bcastaing | last post by:
My Windows service includes the following lines: string Arguments3 = @"%OvAgentDir%\bin\OpC\cmds\ref-ovo-services.vbs ServiceApplicatif ServiceOVO"; string expandedArguments3 =...
4
by: VMI | last post by:
How can I split a string that looks like this: John, Doe, 37282, box 2, 10001, "My description, very important", X, Home If I use String.Split(), it'll split the string that's between the...
4
by: Michael Yanowitz | last post by:
Hello: If I have a long string (such as a Python file). I search for a sub-string in that string and find it. Is there a way to determine if that found sub-string is inside single-quotes or...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.