convertToAltCaps("hello") returns "hElLo" convertToAltCaps
("section is awesome") returns "sEcTiOn Is AwEsOmE"
my program does not work when enter more than 4 letters
Pls Help Me
using System;
using System.Collections.Generic;
using System.Linq; using System.Text;
using System.Threading.Tasks;
namespace AltCap {
class Program {
static void Main(string[] args) {
Console.WriteLine("Enter Your String: ");
string s = Console.ReadLine();
StringBuilder b = new StringBuilder(s);
for(int i = 1; i<b.Length;i+=2) {
char c = Char.ToUpper(b[i]);
b.Replace(b[i], c); }
Console.WriteLine(b);
Console.ReadKey(); } }