How To Change UpperCase To LowerCase

I want to keep the first A-Z uppercase and convert the remaining A-Z into lowercase.

Upvotes: 0

Views: 187

Answers (3)

AdrianHHH
AdrianHHH

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

Oscar Bralo
Oscar Bralo

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

Jerry
Jerry

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

Related Questions