HelperMethods.StripAccelerators Method (String, Char)

Strips non-escaped accelerator markers from the given string

Namespace:  Microsoft.VisualStudio.PlatformUI
Assembly:  Microsoft.VisualStudio.Shell.10.0 (in Microsoft.VisualStudio.Shell.10.0.dll)

Syntax

声明
Public Shared Function StripAccelerators ( _
    input As String, _
    accessSpecifier As Char _
) As String
用法
Dim input As String
Dim accessSpecifier As Char
Dim returnValue As String

returnValue = HelperMethods.StripAccelerators(input, _
    accessSpecifier)
public static string StripAccelerators(
    string input,
    char accessSpecifier
)
public:
static String^ StripAccelerators(
    String^ input, 
    wchar_t accessSpecifier
)
static member StripAccelerators : 
        input:string * 
        accessSpecifier:char -> string 
public static function StripAccelerators(
    input : String, 
    accessSpecifier : char
) : String

Parameters

  • accessSpecifier
    Type: System.Char
    Specifies the character to treat as an access key specifier.

Return Value

Type: System.String
The string.

Remarks

This method uses the same algorithm used by MsoPwchStripWtz (bugs and all), to wit: Strip odd chars that match accessSpecifier from the string.

As per DrawText, consecutive pairs of characters matching accessSpecifier will leave a single character matching accessSpecifier, and all odd characters matching accessSpecifier are removed even though only the last may be underlined.

If a character matching accessSpecifier occurs inside of parens then the parens and the character following the accessSpecifier matching character are also stripped out. This is useful to remove accelarator strings of format (%accessSpecifier%N) which are appended to label in some FE language versions.

NOTE: We do not check for language to do this i.e. we assume that there isn't any realistic label in other languages with (%accessSpecifier%N) stuck in.

.NET Framework Security

See Also

Reference

HelperMethods Class

HelperMethods Members

StripAccelerators Overload

Microsoft.VisualStudio.PlatformUI Namespace