开发者

How do I find all ""-enclosed strings in all .cs files of my solution?

开发者 https://www.devze.com 2023-01-26 02:04 出处:网络
For localization purposes, how can I with as little effort as possible find all remaining \"strings\", in all my .cs files in all projects in a solution, that are not inside a comment? Regex in the Fi

For localization purposes, how can I with as little effort as possible find all remaining "strings", in all my .cs files in all projects in a solution, that are not inside a comment? Regex in the Find dialog? 开发者_运维问答Some other special tool?


One way is to first strip out all comments from your .cs files. Keep a backup of original files, of course. This post contains a sed script that will help you here. Note: it works for C and C++ style comments; if you've got some specific C# comments, it shouldn't be too hard to modify that script.

Next, finding all strings shouldn't be too hard using regex. I'd suggest using grep first on your .cs files, just to be sure if you're getting what you expect.


Resource Refactoring Tool at CodePlex:

Resource Refactoring Tool provides developers an easy way to extract hard coded strings from the code to resource files.

0

精彩评论

暂无评论...
验证码 换一张
取 消