i want to make this string ,

"'basic@yahoo.com'"

like this

"basic@yahoo.com"

in asp.net , via .Repalce function,

Did you try this...

string strText = "'basic@yahoo.com'";
Response.Write(strText.Replace("'", ""));

yes, but it completely ommits the quotes ,
i want to keep " " .
like "basic@yahoo.com"

Member Avatar for stbuchok

HunainHafeez, what JorgeM is showing you is correct. It is replacing any single quote with an empty string. Another way to write this is:

string strText = "'basic@yahoo.com'";
Response.Write(strText.Replace("'", String.Empty));

If your string already contains double quotes, they will remain.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.