开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜