Inline Format Item
In This Article
Inserts a String.Format argument into the operated string instead of the appropriate format item (e.g. {0}), and deletes the String.Format call, if it contains only one argument.
#Availability
Available from the context menu or via shortcuts:
- when the cursor is on a format item.
- when the cursor is on a format item value.
#Notes
- This refactoring is the opposite of Introduce Format Item.
#Examples
string res = String.Format("str1 = │{0}, str2 = {1}", "aaa", "bbb");
Dim res As String = String.Format("str1 = │{0}, str2 = {1}", "aaa", "bbb");
Result:
string res = │String.Format("str1 = aaa, str2 = {0}", "bbb");
Dim res As String = │String.Format("str1 = aaa, str2 = {0}", "bbb");