Back to Devexpress

Paste Replace Word

coderushforroslyn-400585-coding-assistance-clipboard-tools-paste-replace-word.md

latest1.6 KB
Original Source

Paste Replace Word

  • Feb 24, 2022
  • 2 minutes to read

The Paste Replace Word feature allows you to replace an identifier under the caret with a word on the clipboard without selecting this identifier.

Note

The Paste Replace Word feature works in C#, Visual Basic, XAML, and HTML code.

How to Enable

The Ctrl+B shortcut that runs the “PasteReplaceWord” command is initially disabled. Do one of the following to enable “Paste Replace Word”:

  • Assign a different shortcut to the “PasteReplaceWord” command. For information on how to change shortcuts, refer to the following example: How to Resolve Keyboard Shortcut Conflicts.

  • Enable the Ctrl+B shortcut for the “PasteReplaceWord” command. Follow the steps below:

  1. Select the CodeRush | Shortcuts… menu item to open the Shortcuts options page.

  2. Type “ctrl+b” in the search text box and enable the Ctrl+B shortcut for the “PasteReplaceWord” command.

  3. Click OK to save this change and close the Shortcuts options page.

How to Use

  1. Copy a word to the clipboard. You can use the Smart Cut and Copy feature in C# and Visual Basic code.

  2. Place the caret in an identifier.

  3. Press Ctrl+B to replace the identifier with the word on the clipboard.

XAML Support

The following screencast demonstrates how to replace the Color property value with the value on the clipboard in XAML code: