How do you escape the forward slash character (/
) in VBScript? For example, in the following string:
bob = "VU administration/front desk"
Normally in most of the languages, the escape character is backslash ( \ ). In VBScript, the escape character is a double quote ( ” ) itself.
Use the String. replace() method to remove a trailing slash from a string, e.g. str. replace(/\/+$/, '') . The replace method will remove the trailing slash from the string by replacing it with an empty string.
character, use \?. Marks the next character as either a special character, a literal, a backreference, or an octal escape. For example, 'n' matches the character 'n'. '\n' matches a newline character.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With