Create

Creates a FormerEscapeSequence that holds a text and its replacement.

Syntax: object.Create ( escape, replacement ) As FormerEscapeSequence

object
required An object expression that evaluates to a FormerEscapeSequence. The class is not predeclared, so create an instance with New first.
escape
required A String, the text to look for. The parameter is declared ByRef.
replacement
required A String, the replacement text. The parameter is declared ByRef.

Returns a new FormerEscapeSequence whose EscapeString and ReplacementString hold the arguments. The object that Create is called on is not changed.

Remarks

The class has no constructor with arguments. Create takes its place: it makes a new instance, fills in the two properties through their Friend setters and returns it.

Example

Dim factory As New FormerEscapeSequence

Dim esc As FormerEscapeSequence
Set esc = factory.Create("\n", vbNewLine)
Debug.Print esc.EscapeString        ' \n
Debug.Print Len(esc.ReplacementString)  ' 2
Debug.Print (esc Is factory)        ' False

See Also