473,486 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to remove " character from string in c#?

Hi there,

i've tried the following:

string s = myString.Replace(""","");... but the compiler just doesnt like
it.
So, if there is a " in the string of text, i'd like to remove it.

any help appreciated.
thanks,
Paul
Mar 15 '07 #1
3 109914
VJ
string s = myString.Replace("\"","");

VJ

"Milsnips" <mi******@hotmail.comwrote in message
news:uc**************@TK2MSFTNGP05.phx.gbl...
Hi there,

i've tried the following:

string s = myString.Replace(""","");... but the compiler just doesnt like
it.
So, if there is a " in the string of text, i'd like to remove it.

any help appreciated.
thanks,
Paul

Mar 15 '07 #2
aah yes thats it - the backslash was missing! thanks,
Paul

"VJ" <no***********@yahoo.comwrote in message
news:Ot**************@TK2MSFTNGP03.phx.gbl...
string s = myString.Replace("\"","");

VJ

"Milsnips" <mi******@hotmail.comwrote in message
news:uc**************@TK2MSFTNGP05.phx.gbl...
>Hi there,

i've tried the following:

string s = myString.Replace(""","");... but the compiler just doesnt like
it.
So, if there is a " in the string of text, i'd like to remove it.

any help appreciated.
thanks,
Paul


Mar 15 '07 #3
If you are using C# the following is what you would need to do:

string s = myString.Replace("\"","");

It requires an escape to recognize the quote.

Cheers!

Rob
"Milsnips" wrote:
Hi there,

i've tried the following:

string s = myString.Replace(""","");... but the compiler just doesnt like
it.
So, if there is a " in the string of text, i'd like to remove it.

any help appreciated.
thanks,
Paul
Mar 15 '07 #4

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

Similar topics

1
36045
by: Ren? M?hle | last post by:
I have a psp script with a procedure just to run an update on one table. The Problem occurs when I try to compile this script with pspload: ORA-20006: "frsys_updatereport.psp": compilation...
0
2156
by: MLH | last post by:
Is an apostrophe a character of special significance to MySQL in a way that would cause "Bob's dog" to become translated into a 12-character string when typed into a MySQL memo field? If I type...
7
2494
by: Justin | last post by:
i need to build the unsigned character string: "PR0N\0Spam\0G1RLS\0Other\0Items\0\0\0" from the signed character string: "PR0N Spam G1RLS Other Items" Tokeninzing the character string is not...
5
4836
by: Karthik | last post by:
Hello! I am not a wizard in this area! Just need some help out in this. I am trying to convert bstr string to new character string. Here is the snippet of my code. **** Code Start**** ...
25
6502
by: lovecreatesbeauty | last post by:
Hello experts, I write a function named palindrome to determine if a character string is palindromic, and test it with some example strings. Is it suitable to add it to a company/project library...
8
11845
by: Brand Bogard | last post by:
Does the C standard include a library function to convert an 8 bit character string to a 16 bit character string?
1
6573
by: shama | last post by:
Hi all, I am using BSTR data type for storing string and want to remove special character (# ' : )from that string. Is there any function for this.... As CString class has "SpanExcluding". or...
3
1343
by: =?Utf-8?B?TWlsaXRhcnkgU211cmY=?= | last post by:
I am trying to use a String as part of a query. Here is the line: strQuery = "Select Filename, Path from d11mw-zes215643.System..SCOPE() where Filename = 'main.swf'" The code works IF I...
3
20612
by: blazeboy | last post by:
Hello, I am using a SQL data source to insert records into a table. The table uses a GUID as the primary key (GoalEventID), and a GUID for a second field (GoalID) as a foreign key. When I call...
0
7099
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
6964
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
5430
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
4864
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
4559
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
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
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
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
262
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.