Skip to content
| Marketplace
Sign in
Visual Studio>Tools>Strings To Constants
Strings To Constants

Strings To Constants

Federico Coletto

|
1,031 installs
| (2) | Free
Strings To Constants Extension for Visual Studio. This simple extension adds a "Extract Constants From Strings" command to the "Tools" menu. The command extract all the strings inside the class, converting them to member constants
Download

This simple extension adds an "Extract strings to constants" command to the "Tools" menu.

The command extract all the strings inside the class, converting them to member constants.

If a string is duplicated or has already been extracted, the same constant reference is used.

The generated constant variable name is generated from the content of the string itself.

Special characters are ignored.

 

1) Sample: the original code

 

2) Select the code you want to refactor

3) Click the command in the menu

4) Refactored code

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft