473,480 Members | 1,852 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How To name a string variable which contain the sign ""

Ji
Hi
I have a sting which is -- This is a "dog" !
then I needed to named it to a string variable such as
Dim S as string
S = "This is a "dog"! "

But it does not work ,how to make it?
Thanks

Nov 20 '05 #1
6 1271
S = "This is a ""dog""!"

"Ji" <an*******@discussions.microsoft.com> wrote in message
news:3E**********************************@microsof t.com...
Hi
I have a sting which is -- This is a "dog" !
then I needed to named it to a string variable such as
Dim S as string
S = "This is a "dog"! "

But it does not work ,how to make it?
Thanks

Nov 20 '05 #2
* "=?Utf-8?B?Smk=?=" <an*******@discussions.microsoft.com> scripsit:
I have a sting which is -- This is a "dog" !
then I needed to named it to a string variable such as
Dim S as string
S = "This is a "dog"! "


\\\
s = "This is a ""dog""! "
///

Alternatively, you can concatenate the string ('ControlChars.Quote').

--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>
Nov 20 '05 #3
Cor
Hi Herfried,
\\\
s = "This is a ""dog""! "
///


Greath code, I did not know you could this already, did you find this
yourself or did you take this from the poster who did send that 5 hours
before you?

That alternative is of course not a good answer, that does nobody.

:-)

Cor
Nov 20 '05 #4
Cor,

* "Cor" <no*@non.com> scripsit:
\\\
s = "This is a ""dog""! "
///
Greath code, I did not know you could this already, did you find this
yourself or did you take this from the poster who did send that 5 hours
before you?


?!?
That alternative is of course not a good answer, that does nobody.


Mhm... I know at least one programmer (not me) who always uses the
constant and defined his own 'vbQuote' in VB6.

;-)

--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>
Nov 20 '05 #5
j2s
> Mhm... I know at least one programmer (not me) who always uses the
constant and defined his own 'vbQuote' in VB6.

Considering the fact that for every string literal you use, .NET will
actually create a new string object, I think it's a good idea to
define your own constants.

I, for example, have a class to define things like single, double
quotes, opening and closing parentheses, etc. Just stuff i use on a
regular basis.
Nov 20 '05 #6
* j2**@hotmail.com (j2s) scripsit:
Mhm... I know at least one programmer (not me) who always uses the
constant and defined his own 'vbQuote' in VB6.


Considering the fact that for every string literal you use, .NET will
actually create a new string object, I think it's a good idea to
define your own constants.

I, for example, have a class to define things like single, double
quotes, opening and closing parentheses, etc. Just stuff i use on a
regular basis.


Remember that "hardcoding" the quote character by typing it twice will
/not/ cause any string concatenation, in opposite to concatenating it to
a constant, for example 'vbQuote'.

--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>
Nov 20 '05 #7

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

Similar topics

3
2413
by: aa | last post by:
I am traing to output the following HTML string from PHP: "<td><input name='".$i-2."' size='2' type='text' onBlur='myfunction(".$i-2.")'></td>" But it somehow mistreats $i-2. PHP does not throw...
2
17731
by: John Davis | last post by:
I want to know what's the differences between Request.Form("Field Name") and Request.QueryString("Field Name") OR they function exactly the same, which is to return the value of the field?? ...
7
14411
by: charliewest | last post by:
Using .Net Compact Framework, I have an ImageButton control (derived from the Button control) this is wired to a click event. The click event's receives the standard arguments (sender, e). How is...
11
2230
by: mfglinux | last post by:
Hello to everybody I would like to know how to declare in python a "variable name" that it is in turn a variable In bash shell I would wrote sthg like: for x in `seq 1 3` do M$i=Material(x)...
0
7049
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6912
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
7092
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5348
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4790
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4488
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1304
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
565
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
188
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.