Vim如何替换为大写或小写

Vim、Emacs配置和使用
回复
gqqnbig
帖子: 84
注册时间: 2011-02-17 9:11

Vim如何替换为大写或小写

#1

帖子 gqqnbig » 2011-05-20 10:55

我要利用s(替换)功能。

例如,我写代码,希望所有字符串都是大写字母开头。

string str1="hello world";
string anotherString="do you know me?";

通过s、正则表达式、以及我要问的功能,上述代码能变成
string str1="Hello world";
string anotherString="Do you know me?";

所以可以怎么做?

具体来说,就是怎么把正则捕获到的分组转换为大写或小写。
头像
lilydjwg
论坛版主
帖子: 4249
注册时间: 2009-04-11 23:46
系统: Arch Linux
联系:

Re: Vim如何替换为大写或小写

#2

帖子 lilydjwg » 2011-05-20 11:24

囧,这种事不去翻文档。。。

\u 啊

代码: 全选

:h sub-replace-special
回复