-1
A Program in c# that reads a string string, and prints it on the console in such a way that the vowels are replaced,.
-1
A Program in c# that reads a string string, and prints it on the console in such a way that the vowels are replaced,.
0
I didn’t quite understand what you wanted, but it would be something like this ?
string line = "testandoyyiiaaaccccbbb";
//Busca o caractere que mais se repete.
var maxRepeat = line.ToArray()
.GroupBy(x => x.ToString())
.ToDictionary(x => x.Key,
x => x.Count(),
StringComparer.OrdinalIgnoreCase)
.OrderByDescending(x => x.Value)
.First();
//Troca todas as vogais pelo caractere que mais se repete.
var result = line.Replace("a", maxRepeat.Key)
.Replace("e", maxRepeat.Key)
.Replace("i", maxRepeat.Key)
.Replace("o", maxRepeat.Key)
.Replace("u", maxRepeat.Key);
Console.WriteLine($"Caractere que mais se repete: {maxRepeat.Key}");
Console.WriteLine(result);
Console.ReadLine();
When you don’t understand, you don’t answer. The question is just a statement and Rena has no way to be answered properly. I’m pretty sure that code is not what the person actually wanted, because it can do something much better, and that’s why we didn’t answer that. It may be an answer, but it’s not a good one, it teaches people something bad.
Browser other questions tagged c#
You are not signed in. Login or sign up in order to post.
Come on, it’s not worth the hyena ... You need to make a face ... and bring us doubts
– novic
I don’t really know how to proceed with community rules, but I do know that I really need help... @Virgilionovic
– Manzambi Bambi Konde