Reputation: 23
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 A-Z
uppercase and convert the remaining A-Z
into lowercase.
Upvotes: 0
Views: 187
Reputation: 14038
The TextFX plugin for Notepad++ provides a number of case conversions. The sub menu TextFx => TextFx Characters => Proper case should do what you want.
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.
Upvotes: 0
Reputation: 1907
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
Upvotes: 0
Reputation: 71538
If you want to convert uppercase words (containing only [A-Z]
), you can use the following:
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.
Upvotes: 2