Introduce Format Item
Extracts a part of the formatted string into a format item. This Code Provider is especially useful if you used to construct a string first and then replace its parts with the variables.
Available when a part of the formatted string is selected.
Select a part of the formatted string.
- Press the Ctrl + . or Ctrl + ~ shortcut to invoke the Code Actions menu.
- Select Introduce Format Item from the menu.
After execution, the Code Provider creates a string.Format call with the selected part extracted into a format item. If the string is already a format string, the selected part will be added as a new format item to the existing composite formatting method.