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

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

问题描述

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

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天全站免登陆