JetBrains Rider
 
Get JetBrains Rider
You are viewing the documentation for an earlier version of JetBrains Rider.

Split lines containing string literals

Last modified: 05 April 2022

When you type long string literals, JetBrains Rider helps you split the lines and add the necessary quotation marks and plus signs.

While the caret is within a string literal,

JetBrains Rider: Splitting string literals

pressing Enter will split the string correctly so that your code syntax does not get broken:

JetBrains Rider: Splitting string literals

Now, if you delete the + sign, the string parts will be back together without redundant quotes.

Another way of splitting a string literal is to set the caret where you want to split the string, press Alt+Enter and choose Split string. This context action will also add necessary quotation marks and +, but both parts of the string will stay on the same line.