WebSite-Watcher         S a v e   T i m e ,   S t a y   I n f o r m e d !
Home       Features       Screenshots       Videos       Downloads       Buy Now       Knowledgebase



Search Knowledgebase:

 

Plugin: Escape certain characters

User question:

> I'm writing a plugin and need to escape certain characters in an

> URL. Is there a function available to escape characters?

 

No, there's no built in function available.

 

Here's a small function that you can use as starting point to escape certain characters:

 

 

Function EscapeChars(As String) As String
   Dim i, s2
   s2 = ""
   For i = 1 To Length(s)
      If Pos(LowerCase(s[i]), "abcdefghijklmnopqrstuvwxyz0123456789%.") > 0 Then
         s2 = s2 + s[i] 
      Else
         s2 = s2 + "%" + IntToHex(Ord(s[i]), 2)
      End If
   Next
   Return s2
End Function

 

 

Usage:

 

= EscapeChars("http://www.domain.com/image.jpg")

 

Result:

 

= http%3A%2F%2Fwww.domain.com%2Fimage.jpg






Privacy Policy - Terms and Conditions - Contact - Impressum/Imprint

Copyright © 2000-2018 Aignesberger Software GmbH
www.aignes.com