共用方式為


ProjectCollection.Escape Method

Converts special characters in a string to MSBuild escape format.

MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.

Namespace:  Microsoft.Build.Evaluation
Assembly:  Microsoft.Build (in Microsoft.Build.dll)

Syntax

'Declaration
Public Shared Function Escape ( _
    unescapedString As String _
) As String
public static string Escape(
    string unescapedString
)
public:
static String^ Escape(
    String^ unescapedString
)
static member Escape : 
        unescapedString:string -> string
public static function Escape(
    unescapedString : String
) : String

Parameters

  • unescapedString
    Type: System.String

    The string to be converted.

Return Value

Type: System.String
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.

.NET Framework Security

See Also

Reference

ProjectCollection Class

Microsoft.Build.Evaluation Namespace