Search code examples
vbscriptstring

How to escape slash (/) in VBScript?


How do you escape the forward slash character (/) in VBScript? For example, in the following string:

bob = "VU administration/front desk"

Solution

  • You don't escape it: it doesn't mean anything special in php or vbscript, and therefore doesn't need to be escaped. The only character you need to escape in vbscript is the double quote, which escapes itself:

    MyString = "He said, ""Here's how you escape a double quote in vbscript. Slash characters -- both forward (/) and back (\) -- don't mean anything, even when used with common control characters like \n or \t."""
    

    Similarly, in php a backslash escapes itself, but a forward slash doesn't need any special handling.