是否可以在Visual Studio中替换为大写字母? [英] Is it possible to replace to uppercase in Visual Studio?

查看:142
本文介绍了是否可以在Visual Studio中替换为大写字母?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在Visual Studio中使用查找和替换"对话框和RegEx(?)替换大写字母:. => Upper(.)?

Is it possible to replace to upper case in Visual Studio using "Find and Replace" dialog and RegEx (?) à la: . => Upper(.)?

说我有

m_<b>a</b>blabla

我想要:

_<b>A</b>blabla

推荐答案

您可以通过使用Visual Studio临时宏来解决此问题.这是一项非常强大,灵活的功能,我一直使用它来执行重复的代码操作.

You can solve this by using Visual Studio temporary macros. This is a very powerful, flexible feature which I use all the time for performing repetitive code manipulations.

我假设您在这里使用C#默认键绑定.

I'm assuming you're using the C# default key bindings here.

  1. CTRL + SHIFT + F 可以在文件对话框中显示查找内容.
  2. 点击使用正则表达式"
  3. 将查找内容:"设置为"<m_:Ll"-以m,下划线和小写字母开头的单词;
  4. 单击查找全部"以搜索所有出现的内容;
  5. CTRL + SHIFT + R 开始记录临时宏;
  6. F8 查找下一个搜索表达式;
  7. 按下向右光标,向右光标, SHIFT +向右光标(跳过"m_",然后选择小写字母);
  8. CTRL + SHIFT + U 将小写字母大写;
  9. CTRL + SHIFT + R 停止录制临时宏;
  10. CTRL + SHIFT + P 可以重播临时宏,该宏将跳至下一个表达式,并在"m_"后的首字母大写".您需要按表达式次数按 CTRL + SHIFT + P 多次.
  1. Press CTRL+SHIFT+F to bring up the find in files dialogue.
  2. Click use "Regular expressions"
  3. Set "Find what:" to "<m_:Ll" - words that begin with m, underscore, then a lower case letter;
  4. Click "Find all" to search for all occurrences;
  5. Press CTRL+SHIFT+R to start recording temporary macro;
  6. Press F8 to find next occurrence of search expression;
  7. Press right cursor, right cursor, SHIFT + right cursor (to skip "m_" and then select the lower case letter);
  8. Press CTRL+SHIFT+U to uppercase the lower case letter;
  9. Press CTRL+SHIFT+R to stop recording temporary macro;
  10. Press CTRL+SHIFT+P to replay temporary macro, which will jump to next expression and uppercase the first letter after the "m_". You need to press CTRL+SHIFT+P as many times as there are expressions.

这篇关于是否可以在Visual Studio中替换为大写字母?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆