Extract String to Resource

Extracts the string at the caret into a resource file.

Availability

Available from the context menu or via shortcuts:

  • when the caret is on a string. This string shouldn't be assigned to a constant, or be an attribute value.

Notes

  • This refactoring automatically suggests the name for the newly created resource string. You can then modify this name in the Resources browser, and the code will be updated automatically.

Example

string MyString = "My text";
Dim MyString As String = "My text"

Result:

string MyString = Properties.Resources1.MyStringValue;
Dim MyString As String = My.Resources.Resources.MyStringValue

Screenshot

rsExtractStringToResource

See Also