Skip to main content

Paste smarter with SmartPaster

April 29, 2014 mgroves 0 Comments
Tags: Visual Studio csharp

One of my favorite VS extensions is SmartPaster. Often when I'm pasting something into Visual Studio, I'm pasting it into C# source code. It could be a long directory name, a JSON string, or some sort of template that's going into a StringBuilder. Doing this with plain copy/paste can be tedious because you need to escape certain characters, and often times VS or ReSharper can be uncooperative.

Instead, just install SmartPaster. You'll get a new right-click menu option: "Paste As", which lets you paste text as a literal string, a comment, or as a StringBuilder.

Screenshot of SmartPaster in Visual Studio

Here's an example of Paste As -> StringBuilder. Notice that it even does the string escaping for you (see the double quotes around "Paste As").

It's not useful every day, but it's a huge time saver when it is.

Comments

Matthew D. Groves

About the Author

Matthew D. Groves lives in Central Ohio. He works remotely, loves to code, and is a Microsoft MVP.

Latest Comments

Twitter