Write a program to which accepts string from user and returns a string in which each character is exactly repeated once.
For example
Input:
Mahesh
Output:
MMaahheesshh
Solution
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RepetinLetter
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter text");
var str = Console.ReadLine();
var strBuilder = new StringBuilder();
foreach (var ch in str)
{
strBuilder.Append(ch);
strBuilder.Append(ch);
}
Console.WriteLine(strBuilder.ToString());
Console.ReadLine();
}
}
}