[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 336
  • Last Modified:

Server.URLEncode - Needs Uppercase

Hi,

Right now i am using server.urlencode to encode the value..
Ex. Server.URLEncode("Hello World")
Now it return,
Hello%2bWorld

But i want serverUrlEncode to return uppercase value of special characters
Hello%2BWorld
(Note values of "%2b" and "%2B" in both sample)

How can i get the uppercase here??
0
badalpatel
Asked:
badalpatel
1 Solution
 
axtoxic107Commented:
There is no direct property that return the thing you want here. But you can make your function to achieve the solution.


Dim RegEx As New Regex("%.{2}")
        Dim Test As String = HttpUtility.UrlEncode("Hello World")
        Dim Eval As New MatchEvaluator(AddressOf FixCase)
        Test = RegEx.Replace(Test, Eval)
        MsgBox(Test)

    Private Function FixCase(ByVal m As Match) As String
        Return m.Value.ToUpper
    End Function

Open in new window

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now