473,659 Members | 2,488 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Escape Character

In C#, it has a escape chatacter @ then can ingnore all the escape charactrer
in string, how about in VB.NET, any escape character like @?
Thank you
Nov 21 '05 #1
6 27776
=?Utf-8?B?SEsgZ3V5?= <HK***@discussi ons.microsoft.c om> wrote in
news:8B******** *************** ***********@mic rosoft.com:
In C#, it has a escape chatacter @ then can ingnore all the escape
charactrer in string, how about in VB.NET, any escape character like


I don't believe so.

Just double all quotes.
--
Lucas Tam (RE********@rog ers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 21 '05 #2
in string, how about in VB.NET, any escape character like @?
Thank you


No.
Nov 21 '05 #3
C

"HK guy" <HK***@discussi ons.microsoft.c om> wrote in message
news:8B******** *************** ***********@mic rosoft.com...
In C#, it has a escape chatacter @ then can ingnore all the escape charactrer in string, how about in VB.NET, any escape character like @?
Thank you


No, In VB.NET, you can find the special character in module
Microsoft.Visua lBasic.ControlC hars. These constants are equivalent to escape
characters of C#.
Nov 21 '05 #4
* =?Utf-8?B?SEsgZ3V5?= <HK***@discussi ons.microsoft.c om> scripsit:
In C#, it has a escape chatacter @ then can ingnore all the escape charactrer
in string, how about in VB.NET, any escape character like @?


There are no escape characters. Notice that a single quote must be
"encoded" as two single quotes inside a string literal. For special
characters, take a look at 'ControlChars':

\\\
Dim s As String = "Hello" & ControlChars.Ne wLine & "World"
///

There is no runtime performance loss because the compiler will determine
that this is a single constant and store it as a single constant in the
executable file.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #5
Herfried,
\\\
Dim s As String = "Hello" & ControlChars.Ne wLine & "World"
///

There is no runtime performance loss because the compiler will determine
that this is a single constant and store it as a single constant in the
executable file.


It can be true however what the hell of a loss of performance this could
be, even when it is in a loop which goes a billion times it would be less
than a millisecond probably.

:-)

Cor
Nov 21 '05 #6
* "Cor Ligthert" <no**********@p lanet.nl> scripsit:
There is no runtime performance loss because the compiler will determine
that this is a single constant and store it as a single constant in the
executable file.


It can be true however what the hell of a loss of performance this could
be, even when it is in a loop which goes a billion times it would be less
than a millisecond probably.


Full ACK. I only wanted to make sure that the OP doesn't think VB.NET
isn't as clever as C# ;-).

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

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

Similar topics

4
21407
by: Alden Streeter | last post by:
Here is the HTML that is being output by my asp page: <a href='Files/category/computers/bigimages/computers-sub-monitors.jpg' target='_blank' onMouseOver="window.status='Click for a larger image of MONITOR, 19\" CODAR EAGLE.';return true;" onMouseOut="window.status='';return true;"> <img width='98' height='96' border='0' src='Files/category/computers/bigimages/computers-sub-monitors.jpg' alt='MONITOR, 19" CODAR EAGLE'></a>
1
6199
by: Grant Allen | last post by:
I know this has been asked before - I've trawled through the mail archives and FAQs looking for any info, and only found "that's the way it works" answers. Basically, I want to turn off backslash ( \ ) as an escape character in string literals. It makes porting apps to PostgreSQL much more difficult, because no major rdbms behaves this way (at least, none of Oracle, SQL Server,DB2, Sybase, Informix, SQL Anywhere or SQL Base ... the one's...
7
96293
by: teachtiro | last post by:
Hi, 'C' says \ is the escape character to be used when characters are to be interpreted in an uncommon sense, e.g. \t usage in printf(), but for printing % through printf(), i have read that %% should be used. Wouldn't it have been better (from design perspective) if the same escape character had been used in this case too. Forgive me for posting without verfying things with any standard compiler, i don't have the means for now.
3
41867
by: newsgroupie | last post by:
Hi Newsgroupies, Please could someone tell me the escape character for " (double quote) in a string.Format(...) method as \x22 doesn't work as it comes out as \" in the result. i.e. string.Format("you say \x22goodbye\x22 and I say \x22hello\x22"); ....comes out as...
7
22585
by: Steve | last post by:
string str ="\"C:\Program Files\Internet Explorer\iexplore.exe\" -nohome" How can I remove charcter to string str = ="C:\Program Files\Internet Explorer\iexplore.exe -nohome"
3
2606
by: Steve | last post by:
The string in registry is "rundll32.exe C:\Program Files\INTERN~1\hmmapi.dll,OpenInboxHandler" After opensubkey and getregistry, I got "rundll32.exe \"C:\\Program Files\\INTERN~1\\hmmapi.dll\",OpenInboxHandler" Is there anyway I can get the string exactly in registry without escape character?
12
9630
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(" & Chr(34) & PopUpWindowTitle & Chr(34) & ", " & Chr(34) & CurrentEventDetails & ")" strTemp += "<BR><A HREF='#' onClick='" & PopupLink & "'>" & EventName & "</A><BR>" The problem I have is that when the string variables or contain a string with an...
15
18312
by: pkaeowic | last post by:
I am having a problem with the "escape" character \e. This code is in my Windows form KeyPress event. The compiler gives me "unrecognized escape sequence" even though this is documented in MSDN. Any idea if this is a bug? if (e.KeyChar == '\e') { this.Close(); }
3
6540
by: slomo | last post by:
How to read strings cantaining escape character from a file and use it as escape sequences? for example, a file 'unicodes.txt' has contents: \u0050\u0079\u0074\u0068\u006f\u006e Now, '\\u0050\\u0079\\u0074\\u0068\\u006f\\u006e\n'
0
8428
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8630
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7360
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4176
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4342
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.