简体   繁体   English

如何将UpperCase更改为LowerCase

[英]How To Change UpperCase To LowerCase

  • Before: 之前:

     HOW TO ABCD EFGH SCRIPT SCRIPT SCRIPT HOW TO IJKL MNOP SCRIPT SCRIPT SCRIPT HOW TO QRST UVWX SCRIPT SCRIPT SCRIPT 
  • After: 后:

     How To Abcd Eefgh Script Script Script How To Ijkl Mnop Script Script Script How To Qrst Uvwx Script Script Script 

I want to keep the first AZ uppercase and convert the remaining AZ into lowercase. 我想保留第一个AZ大写并将剩余的AZ转换为小写。

If you want to convert uppercase words (containing only [AZ] ), you can use the following: 如果要转换大写单词(仅包含[AZ] ),可以使用以下内容:

Find what: 找什么:

\b([A-Z])([A-Z]+)\b

Replace with: 用。。。来代替:

$1\L$2

\\L converts $2 (the second capture group which has all but the first letter of the word) into lowercase. \\L转换$2 (第二个捕获组,除了单词的第一个字母之外的所有字符)都为小写。

Try this: 尝试这个:

Read one line and do this: 阅读一行并执行此操作:

string text = "SCRIPT SCRIPT SCRIPT";
            StringBuilder sb = new StringBuilder();
            text.Split(' ').ToList().ForEach(x => sb.Append(x.Substring(0, 1).ToUpper() + ((x.Length != 1) ? string.Join("", x.Substring(1, x.Length - 1).ToLower()) : x.ToUpper()) + " "));
            string result = sb.ToString().Trim();

Output 产量

Script Script Script 脚本脚本脚本

The TextFX plugin for Notepad++ provides a number of case conversions. Notepad ++的TextFX插件提供了大量的大小写转换。 The sub menu TextFx => TextFx Characters => Proper case should do what you want. 子菜单TextFx => TextFx Characters => 正确的案例应该做你想要的。

Notepad++ also has some built-in case conversions via the menu Edit => Convert case to , but this does not (as of Notepad++ 6.5.2) provide the variation you want. Notepad ++还有一些内置的大小写转换,通过菜单Edit => Convert case to ,但这不会(从Notepad ++ 6.5.2开始)提供你想要的变化。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM