Refactorings for Resource Files and Strings
Extract String to Resource
Extracts the string at the caret into a resource file. 

After extracting the string, the resource identifier is selected and linked for an easy rename. 
This refactoring is useful if you have text that needs to be translated into one or more target languages. Placing all text that needs translation into a resource file makes it possible to change and add foreign language support without changing the code.
Extract String to Resource (replace all)
Extracts all matching strings in the file to a resource file.
Extract XML Literal to Resource
This refactoring is only available in Visual Basic. Extracts the active embedded XML literal to a resource file. 
After the extraction the resource identifier is selected and linked up for an easy rename. 
Use String.Format
Converts a composed string expression into a single String.Format call. 
Notice in the preview hint how the formatting arguments passed to the ToString calls in the original expression (e.g., "listPrice.ToString("c")") are properly converted to the appropriate format strings (e.g., "{0:c}"). This refactoring is useful if you have concatenated display text such as this that needs to be translated into another language. Complete sentences are more effectively translated than sentence fragments, as they can be grammatically rearranged as is sometimes necessary with translation, without touching the code.
Use StringBuilder
Replaces the selected string concatenation operations with corresponding method calls on a local StringBuilder instance. For example, consider the following code: 
To change these string concatenation operations to equivalent code that works uses a StringBuilder, just select the text to convert and press the CodeRush key (Ctrl+`). 
The preview hint gives you an idea of the changes this refactoring will apply to the code. Old string concatenation operations ("+=") are updated. 
Notice also the intelligent changes applied to the second line that had previously called String.Format. That call has been converted to an AppendFormat call.
|