?
Solved

replace %20 with space

Posted on 2006-03-27
5
Medium Priority
?
384 Views
Last Modified: 2012-06-27
what is the best way to replace all the encoded symbos in a URI to non-encoded.

For example,    %20   is a space.

Should I create a URI object and does it have a property "non-encoded" or something like that. currently I am just using the satement:

sFile = sFile.Replace("%20", " ")

but I would like something better.
0
Comment
Question by:brokeMyLegBiking
5 Comments
 
LVL 6

Expert Comment

by:JRossi1
ID: 16300267
I think your method is a good way to format the URI.  You can store these symbols in a resource file or table and add some logic to search for the symbol and replace with the correct "non-encoded" version.  

Check out the following link:  http://msdn2.microsoft.com/en-US/library/system.uri(VS.80).aspx

There is a great deal of information regarding the URI Class, it's properties and methods.  There may be a "non-encoded" property/method there, but not by that name (I Looked).

0
 
LVL 34

Expert Comment

by:Sancler
ID: 16300727
Is this what you want?

        Dim myUri As New Uri("http://www.contoso.com/Hello%20World.htm", True)
        Debug.WriteLine(myUri.ToString)

Roger
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 2000 total points
ID: 16307034
System.Web.HttpUtility.HtmlDecode(s)

Bob
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16307035
System.Web.HttpUtility.UrlDecode(s)

Bob
0
 
LVL 4

Author Comment

by:brokeMyLegBiking
ID: 16335467
brilliant bob, thanks.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses
Course of the Month15 days, 14 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question