Condividi tramite


ProjectCollection.Escape(String) Method

Definition

Escape a string using MSBuild escaping format. For example, "%3b" for ";". Only characters that are especially significant to MSBuild parsing are escaped. Callers can use this method to make a string safe to be parsed to other methods that would otherwise expand it; or to make a string safe to be written to a project file.

public:
 static System::String ^ Escape(System::String ^ unescapedString);
public static string Escape (string unescapedString);
static member Escape : string -> string
Public Shared Function Escape (unescapedString As String) As String

Parameters

unescapedString
String

The string to be converted.

Returns

The converted string.

Remarks

For example, "%3b" for ";". Only characters that are especially significant to MSBuild parsing are converted. Callers can use this method to make a string safe to be parsed by other methods that would otherwise expand it. Callers can also use this method to make a string safe to be written to a project file.

Applies to