Encoding Strings using Escape Characters: Basic Example

Category:
String Manipulation
Type:
Snippets
Difficulty:
Beginning
Author:
Stephen Goguen

Version Compatibility: Visual Basic 6, Visual Basic 5

More information:
This example encodes the following as:
  • vbCr to "\c"
  • vbLf to "\l"
  • "\" to "\\"

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: