There is the following code, it has a function that finds the letters in word in its middle (1 or 2 characters) and makes them capital, and then outputs.
using System;
public class Program
{
public static void Main()
{
Console.WriteLine(test("Rofl"));
Console.WriteLine(test("Camel"));
Console.WriteLine(test("R"));
}
public static String test(string value) {
return value.Length % 2 == 0
? value.Substring(value.Length / 2 - 1, 2).ToUpper()
: value.Substring(value.Length / 2, 1).ToUpper();
}
}
Tell me, please, how do I make it so that the word was completely derived, but the letters from the middle were completely replaced by capital letters?
It is necessary that it be so:
ROFl
CaMel
R