create c# app that take a name as input and returns it in csharp

Here's a sample code in C# that takes a name as input and returns it in C#:

main.cs
using System;

namespace NameApp
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Please enter your name: ");
            string inputName = Console.ReadLine();

            string outputName = $"Hello, {inputName}! This is your name in C#: {ToCSharpCase(inputName)}";
            Console.WriteLine(outputName);
            
            Console.ReadLine();
        }

        static string ToCSharpCase(string name)
        {
            string[] names = name.Split(" ");
            string csharpName = "";

            foreach (string n in names)
            {
                csharpName += char.ToUpper(n[0]) + n.Substring(1).ToLower();
            }

            return csharpName;
        }
    }
}
762 chars
32 lines

This code uses the Console class to ask the user to input their name. The ToCSharpCase method is called to convert the input name into a C#-style string. The converted name is then displayed back to the user. To run this code, you'll need a C# development environment like Visual Studio.

gistlibby LogSnag