VS 宏/插件将字符串连接转换为 string.format 样式
我有一个正在开发的项目,其中很多地方都使用了诸如“Hi”+variable+“,welcome to Project”之类的字符串操作(给出的示例非常小)。
要求之一是将其转换为 string.format 样式。
这是一项非常漫长且乏味的工作,我不想破坏早期的工作代码,因为在转换它时可能会发生任何人为错误。
我想知道我是否可以创建任何宏或 VS 命令来处理它。就像我们标记代码块并在重构选项中执行提取功能一样。
I have project in development where string operations like "Hi " + variable + ", welcome to Project" are used at many places (given example is very minor one).
One of the requirement is to convert it to string.format style.
It is very long and tedious job, where I would not like to break earlier working code due to any human error might happen while converting it.
I would like to if any Macro or VS command which I can create to handle it. Just like we mark block of code and do Extract function in Re-factor options.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我觉得在这里发布代码有点长,但我在我的博客上发布了答案:
http://www.brianschmitt.com/2010/08/ conversion-concatenated-string-into.html
-- 编辑 --
这里的每条评论都是相关的宏 - 不知道为什么你无法访问......
I felt the code was a little long to post here, but I posted an answer at my blog:
http://www.brianschmitt.com/2010/08/converting-concatenated-string-into.html
-- EDIT --
Per comment here is the relevant Macro - not sure why you cannot access...