Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>auto-string-wrapNew to Visual Studio Code? Get it now.
auto-string-wrap

auto-string-wrap

JoeMoyerClarity

|
4 installs
| (0) | Free
Automatically handles syntax for splitting a string value onto multiple lines
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Auto String Wrap

Version Installs Rating

Automatically handles syntax for splitting long string values onto multiple lines in C# files.

When you press Enter inside a string literal, this extension automatically inserts:

  • A closing quote
  • A concatenation operator (+)
  • A new line with one level of indentation deeper
  • An opening $" (if it was an interpolated string) or " otherwise

Features

  • Automatic formatting of string literals in C#
  • Preserves indentation by adding one extra tab relative to the original line
  • Works with interpolated ($") and standard (") strings
  • No need for manual fiddling with quotes and + operators

Usage

  1. Open any .cs file.
  2. Inside a string, place the cursor where you want a line break.
  3. Press Enter.

Example:

context.Logger.LogError($"Some extremely long log string that would be a lot cooler on two lines {nameof(ThisClass)}");

Press Enter before "lot" becomes

context.Logger.LogError($"Some extremely long log string that would be a " +
    $"lot cooler on two lines {nameof(ThisClass)}");

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft