How to use replace function for "/" character?

A

ABC

I used as:

url.Replace("\", @"/")

but it showed the error as:

error: managed EE does not understand expression's syntax

How to fix it?
 
H

Hans Kesting

I used as:
url.Replace("\", @"/")

but it showed the error as:

error: managed EE does not understand expression's syntax

How to fix it?

url = url.Replace(@"\", "/");

or

url = url.Replace("\\", "/");

Note: it's the \ that has a special meaning which is ignored by the @
in the first version or escaped by doubling it in the second version.

Hans Kesting
 
E

eguworks

Hello ABC,

Whenever I want to replace certain characters from a string I use

dim mystring as string = "this is & my string"

mystring = mystring.replace(" & ", " ")

Wich will return "this is my string"

ofcourse you can bend it into anything you want.

Egu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,526
Members
44,997
Latest member
mileyka

Latest Threads

Top