using System.Globalization;
using System.Collections.Generic;
public static void Main()
Console.WriteLine(TratarNomeCliente("Robson Alexande Goncalves Junior Robson Alexandre Goncalves Junior"));
private static string TratarNomeCliente(string nomeCliente)
string novoNome = string.Empty;
var preposicoes = new string[] { "de", "da", "do", "das", "dos" };
if (nomeCliente.Length <= 75)
List<string> nomeSplit = nomeCliente.Split(' ').ToList();
nomeSplit.ForEach(nome =>
if (novoNome.Length + nome.Length + 1 > 75)
novoNome += nome[0] + " ";
if (preposicoes.Contains(nome.ToLower()) || nome.Length <= 2)
return CultureInfo.CurrentCulture.TextInfo.ToTitleCase(novoNome);