using System;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string s = "you are a great programmer, keep practice";
try
{
s = ReplaceChar(s, 0, 'Y');
Console.WriteLine(s);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
public static string ReplaceChar(string s, int i, char ch)
{
if (s == null)
{
throw new ArgumentNullException("s");
}
StringBuilder sb = new StringBuilder(s);
sb[i] = ch;
return sb.ToString();
}
}
}
/*
run:
You are a great programmer, keep practice
*/