Version

EscapeString Method

Escapes all the special charactes in the specified text. If withinQuotes is true then it only escapes the special characters that need to be escaped within double quotes, namely the '"' and '\' characters.
Syntax
'Declaration
 
Public Shared Function EscapeString( _
   ByVal text As String, _
   ByVal withinQuotes As Boolean _
) As String
public static string EscapeString( 
   string text,
   bool withinQuotes
)

Parameters

text
Text that needs to be escaped.
withinQuotes
Whether the text is going to be enclosed in double quotes. If true then only escapes characters that need to be escaped in double quotes.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also