CodeRush Xpress

Refactorings for Resource Files and Strings

 

Extract String to Resource

Extracts the string at the caret into a resource file.

Refactoring - Extract XML Literal to Resource

Refactoring - Extract String to Resource

After extracting the string, the resource identifier is selected and linked for an easy rename.

Refactoring - Extract String to Resource

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.

Refactoring - Extract XML Literal to Resource

After the extraction the resource identifier is selected and linked up for an easy rename.

Refactoring - Extract XML Literal to Resource

Use String.Format

Converts a composed string expression into a single String.Format call.

Refactoring - Use String.Format

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:

Refactoring - Use StringBuilder

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+`).

Refactoring - Use StringBuilder

The preview hint gives you an idea of the changes this refactoring will apply to the code. Old string concatenation operations ("+=") are updated.

Refactoring - Use StringBuilder

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.

More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.