devxlogo

Tip Bank

Search multiple substrings with the RegExp object

The RegExp object in the Microsoft VBScript Regular Expression type library supports regular expression patterns containing the | (or) operator, which lets you search for multiple substrings at the same

GetIEStartPage – Read IE start page

‘ Get the IE start page’ Note: requires the GetRegistryValue routine, you can find it in the CodeBank’ Example:’ MsgBox GetIEStartPagePublic Function GetIEStartPage() As String Const HKEY_CURRENT_USER = &H80000001 GetIEStartPage

HTMLDecodeEx – Decodes HTML encoded strings

‘ Decodes HTML encoding applied to the specified Text and returns the result’ Optionally specify if we encoded a HREF link and the character’ used for encoding – the default

URLDecodeEx – Decodes an encoded URL

‘ Decodes URL encoding applied to the specified Text and returns the resultPublic Function URLDecodeEx(ByVal Text As String) As String Dim abytTokens() As Byte Dim lngTotal As Long Dim lngCount

URLEncodeEx – Apply URL encoding rules

‘ Applies URL encoding rules to the specified Text and returns the result’ (similar to Server.URLEncode)Public Function URLEncodeEx(ByVal Text As String) As String Dim abytTokens() As Byte Dim lngTotal As

Get the canonical name of a file

In many cases you may need the canonical (or absolute) name of a file, for example when you need to compare two relative file names (relative to the current directory

Use StringBuffer for Speedy Servlet Output

Servlets often need to display a lot of HTML. One way to do this is with println() commands and String concatenation. However, String concatenation is an expensive process. It is

Avoid Instantiability of Utility Classes

There are times when almost every programmer comes up with a class that consists only of public static methods. Usually these are some kind of utility classes, which do not