是否可以在 Visual Studio 中替换为大写? [英] Is it possible to replace to uppercase in Visual Studio?
本文介绍了是否可以在 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.
- 按 CTRL+SHIFT+F 在文件对话框中调出查找.
- 点击使用正则表达式"
- 将查找内容:"设置为
<m_:Ll
" - 以 m、下划线和小写字母开头的单词; - 点击查找全部"以搜索所有出现的内容;
- 按CTRL+SHIFT+R开始录制临时宏;
- 按F8查找下一次出现的搜索表达式;
- 按右光标、右光标、SHIFT + 右光标(跳过m_"然后选择小写字母);
- 按CTRL+SHIFT+U将小写字母大写;
- 按CTRL+SHIFT+R停止录制临时宏;
- 按CTRL+SHIFT+P 重放临时宏,将跳转到下一个表达式并大写m_"后的第一个字母".您需要按 CTRL+SHIFT+P 多次按表达式.
- Press CTRL+SHIFT+F to bring up the find in files dialogue.
- Click use "Regular expressions"
- Set "Find what:" to "
<m_:Ll
" - words that begin with m, underscore, then a lower case letter; - Click "Find all" to search for all occurrences;
- Press CTRL+SHIFT+R to start recording temporary macro;
- Press F8 to find next occurrence of search expression;
- Press right cursor, right cursor, SHIFT + right cursor (to skip "m_" and then select the lower case letter);
- Press CTRL+SHIFT+U to uppercase the lower case letter;
- Press CTRL+SHIFT+R to stop recording temporary macro;
- 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屋!
查看全文