Merge string concatenation
Merge string and template literal concatenation into a single template literal or string.
Template literals are string templates that can include variables and expressions.
They can replace string concatenation and are often easier to read. Example:
This refactoring supports converting the first line of concatenated strings into template literals or shortened strings:
- concatenated string literals will be combined, e.g.
"a" + "b"will become
- concatenated expressions and variables will be embedded in templates, e.g.
"a" + x + "b"will become
- unnecesary escaping of quotes is removed when string are combined or transformed into template literals
- Code Assist ID (for the configuration file):
- You can configure custom keyboard shortcuts with these code action kinds:
- This code assist provides refactoring suggestions. Learn how to configure the refactoring suggestion visibility.
Related Code Assists
- Convert string to template literal
- Convert template literal to string
- Inline into template
- Remove unnecessary template literal