[Solved] Upper case the first letter of some words

[ad_1]

To set to lower all the words below some length, you can split the words, and depending on its length set it to lower case. In this example i split on a space " ",if there’s a possibility of another separators this would get more complicated:

string unidade = "DIREÇÃO DE ANÁLISE E GESTÃO DA INFORMAÇÃO";
string lower = System.Threading.Thread.CurrentThread.CurrentCulture
                               .TextInfo.ToTitleCase(unidade.ToLower());

lower = String.Join(" ", lower.Split(' ').Select(x => x.Length > 2 ? x : x.ToLower()));

In this case I’m setting to lower all words with less than 3 characters.

0

[ad_2]

solved Upper case the first letter of some words