473,785 Members | 3,214 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying to remove "\" from a string

Hello.

I have tried to remove the char "\" from a string that I am building in
codebehind.
to be used in a script tag.

I have tried adding (char)34 to the string instead of the escape character,
as well as @then double quotes.
when i watch the string in the command window or the watch window it has the
escape character in the string allways \"
I have tried to use replace.. but you cant replace a escape character, I
tryed establishing a char variable as (char)92

My question is how the heck can I build a string without an escape character
around the quotes ?

Thanks,
Rob
Nov 18 '05 #1
4 2343
use
\\
Escape the escape char

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
<Ro****@Rob.com > wrote in message
news:JZ******** ************@gi ganews.com...
Hello.

I have tried to remove the char "\" from a string that I am building in
codebehind.
to be used in a script tag.

I have tried adding (char)34 to the string instead of the escape character, as well as @then double quotes.
when i watch the string in the command window or the watch window it has the escape character in the string allways \"
I have tried to use replace.. but you cant replace a escape character, I
tryed establishing a char variable as (char)92

My question is how the heck can I build a string without an escape character around the quotes ?

Thanks,
Rob

Nov 18 '05 #2
i did not understand your problem but those sample might help you.

Code ---- You see
Response.Write( \\aa\\bb) --- \aa\bb
Response.Write( "\"aa") ---- "aa

George
My Site - Body Jewelry
<Ro****@Rob.com > wrote in message news:JZ******** ************@gi ganews.com...
Hello.

I have tried to remove the char "\" from a string that I am building in
codebehind.
to be used in a script tag.

I have tried adding (char)34 to the string instead of the escape character,
as well as @then double quotes.
when i watch the string in the command window or the watch window it has the
escape character in the string allways \"
I have tried to use replace.. but you cant replace a escape character, I
tryed establishing a char variable as (char)92

My question is how the heck can I build a string without an escape character
around the quotes ?

Thanks,
Rob
Nov 18 '05 #3
s = s.Replace("\\", "");
double up the escape char.

Bobby Ryzhy
bobby@ name of domain below
http://www.weekendtech.net

On Wed, 7 Jul 2004 20:01:57 GMT, Ro****@Rob.com wrote:
Hello.

I have tried to remove the char "\" from a string that I am building in
codebehind.
to be used in a script tag.

I have tried adding (char)34 to the string instead of the escape character,
as well as @then double quotes.
when i watch the string in the command window or the watch window it has the
escape character in the string allways \"
I have tried to use replace.. but you cant replace a escape character, I
tryed establishing a char variable as (char)92

My question is how the heck can I build a string without an escape character
around the quotes ?

Thanks,
Rob


Nov 18 '05 #4

<Ro****@Rob.com > wrote in message news:JZ******** ************@gi ganews.com...
Hello.

I have tried to remove the char "\" from a string that I am building in
codebehind.
to be used in a script tag.

I have tried adding (char)34 to the string instead of the escape character,
as well as @then double quotes.
when i watch the string in the command window or the watch window it has the
escape character in the string allways \"
I have tried to use replace.. but you cant replace a escape character, I
tryed establishing a char variable as (char)92

My question is how the heck can I build a string without an escape character
around the quotes ?

Thanks,
Rob


Probably you don't need to worry:
the watch and debugger windows just *display* the string with escaped
inner quotes and maybe a "@" in front. Try and set a label to display
the value, you should not see the escape characters then, or
find out the length of the string.

So, if the *real* value is
this is a "test"
the watch window might display
@"this is a \"test\""

Hans Kesting
Nov 18 '05 #5

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

Similar topics

4
45461
by: Soundneedle | last post by:
I have a string value that is equal to: My neighbor has a dog (Fido). How can I strip off the "(Fido)" part using VBA?
4
2213
by: ouch | last post by:
Hi Everyone, Is there any way to remove the "@" from a verbatim string? I've tried the .remove(int, int) method, but it doesn't work. Thanks ouch
3
5102
by: Lee Roth | last post by:
I am testing a web app that links to user defined URLs. I want the link to be the exact text the user provided but I can't seem to get rid of the "http://localhost" prefix in the link. Note that I am user defined email addresses for "mailto:" links and the same problem occurs. Is this something that will be removed when the site is published? All help is appreciated, Lee
4
768
by: Chicagoboy27 | last post by:
All I am trying to find a solution for removing the ?returnUrl if a user is not authenticated. I want to be redirect an unauthenticated user to the login.aspx less the returnUrl. Once they log in I specifically want them to go to the default.aspx page and not the "ReturnUrl=" page. currently my sight is set up to redirect to the log in but I am looking to remove the ?returnurl so that it goes to the normal defualt.aspx Currently I am...
3
109937
by: Milsnips | last post by:
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,
2
6581
by: Konstantinos Pachopoulos | last post by:
Hi, i have the following string s and the following code, which doesn't successfully remove the "\", but sucessfully removes the "\\". .... if i!="\\": .... newS=newS+i .... 'Sadasd\x07sd' I have also read the following, but i do not understand the "...and the
1
2095
by: Dilruba | last post by:
I want the suggestion what is better for use between Session.abandon & Session.Contents.Remove
6
6538
by: RSbroman | last post by:
I have created an append query that I would like to run when the DB is opened. However I do not want the end user to receive the "yes" "no" confirmation box when the query is being run. Can anyone help me remove this confirmation box?
4
9863
by: FullBandwidth | last post by:
I have been perusing various blogs and MSDN pages discussing the use of event properties and the EventHandlerList class. I don't believe there's anything special about the EventHandlerList class in this context, in fact some articles from pre-2.0 suggest using any collection class of your choice. So my questions focus more on the syntax of event properties provided by the "event" keyword in C#. (Disclaimer - I am a C++ programmer working...
0
9643
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
10315
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
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10085
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9947
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
8968
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
7494
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
6737
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.