473,503 Members | 7,823 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Inserting double quotes in a textbox

304 Contributor
hi,
Is there a way for inserting double quotes in a texbox?

i.e. i would like achieve something like this ->

Gomzi"Gomzi (should be displayed in a textbox).

Tried both using backslashes and html encode without much success.
May 6 '07 #1
8 2449
Hybrid
6 New Member
textBox1.Text = '"' + "lawl" + '"';

This isolate's the qutations into "char's".
May 7 '07 #2
vanc
211 Recognized Expert New Member
If you want to display any special character, just add "\" before it (without double quotes)

eg: Console.WriteLine("ab\"cd"); --> ab"cd

cheers.
May 7 '07 #3
gomzi
304 Contributor
textBox1.Text = '"' + "lawl" + '"';

This isolate's the qutations into "char's".
Doesn't work. I get an error :- 'Expression expected'
May 7 '07 #4
gomzi
304 Contributor
If you want to display any special character, just add "\" before it (without double quotes)

eg: Console.WriteLine("ab\"cd"); --> ab"cd

cheers.
Would like to input double quotes inside a texbox. The above method doesn't work in that case.
May 7 '07 #5
vanc
211 Recognized Expert New Member
Did you try it, my friend?

txtTemp.Text = "abc\"dhnc";
output: abc"dhnc
May 9 '07 #6
gomzi
304 Contributor
Did you try it, my friend?

txtTemp.Text = "abc\"dhnc";
output: abc"dhnc
of course i did.
i m getting two errors.
1->End of statement expected.
2->syntax error

My code :-

Me.txtpath.Text = "<a href=http://myurl.com?url=something>"

[I have left out the rest of the strings.]

i would like to place double quotes around href.
how should i go about it?
May 9 '07 #7
vanc
211 Recognized Expert New Member
I think we were talking about C# now you switch to VB!!! In VB two double quote = one double quote.

txtpath.Text = "AB""CD"
Output: AB"CD

Is your problem done?
May 10 '07 #8
gomzi
304 Contributor
I think we were talking about C# now you switch to VB!!! In VB two double quote = one double quote.

txtpath.Text = "AB""CD"
Output: AB"CD

Is your problem done?
I don't remember ever mentioning that I was talking of c#.
You were posting in c# and I assumed that the method would be the same for vb.net also. May be that was my fault.
Anyway, the above method you specified works great.
Thanks.
May 10 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

7
3785
by: Rainmaker | last post by:
Greetings, I have not been able to find the documentation that will allow me to insert php code inside the html code in the $message block in the mail() function. Using the example in the help...
2
4299
by: Bill | last post by:
I'm trying to create a form that allows me to modify the contents of list. When the user clicks on the modify button, it takes them to a page which displays the quantity of items they purchase, and...
2
4020
by: Jon Maz | last post by:
Hi, I have written a page to test a function of mine that strips non-English accents and various other characters out of a given string. The function itself (called 'StripAll' in the code below)...
7
20882
by: gar | last post by:
Hi, I need to replace all the double quotes (") in a textbox with single quotes ('). I used this code text= Replace(text, """", "'" This works fine (for normal double quotes).The problem...
0
7193
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
7264
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
7316
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...
1
6975
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...
1
4992
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
4666
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
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
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 ...
0
371
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.