HelperMethods.StripAccelerators Method (String)
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
'Dichiarazione
Public Shared Function StripAccelerators ( _
input As String _
) As String
'Utilizzo
Dim input As String
Dim returnValue As String
returnValue = HelperMethods.StripAccelerators(input)
public static string StripAccelerators(
string input
)
public:
static String^ StripAccelerators(
String^ input
)
static member StripAccelerators :
input:string -> string
public static function StripAccelerators(
input : String
) : String
Parameters
- input
Type: System.String
String to strip.
Return Value
Type: System.String
Remarks
This method uses the same algorithm used by MsoPwchStripWtz (bugs and all), to wit: Strip odd '&' chars from the string. As per DrawText, consecutive pairs of '&'s will leave a real '&' character, and all odd '&'s are removed even though only the last may be underlined. If an '&' occurs inside of parens then the parens and the character following the '&' are also stripped out. This is useful to remove accelarator strings of format (&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 (&N) stuck in.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.