Skip to content

Tip 1.10: How to transpose characters, words, and lines in the editor

February 11, 2011

“Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio“, courtesy of ‘Sara Ford’

Sara Ford’s Blog

You can use three commands for swapping or transposing text in the editor, namely:

  • Press Ctrl+T to transpose a character
  • Press Ctrl+Shift+T to transpose a word
  • Press Alt+Shift+T to transpose a line

In the following example(where the cursor is placed before the “is” on the commented line “now is the time”), Sara will apply the three commands to illustrate how text is swapped.

Console Main Method To demo Ctrl+T, Ctrl+Shift+T, Alt+Shift+T on a comment

  • Pressing Ctrl+T swaps the “i” and the previous space, creating “// nowi s the time”.
  • Pressing Ctrl+Shift+T swaps “is” and “the”, creating “// now the is time”.
  • Pressing Alt+Shift+T swaps the current line with the line below it.

Happy Programming! =)

Advertisements
One Comment
  1. patel rikin permalink

    thks ………nice……

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: