Following method replaces a character at a given index of a string.
// Replaces a character in a string with the character specified.
void replaceCharWithChar(ref string text, int index, char charToUse)
{
char[] tmpBuffer = text.ToCharArray();
tmpBuffer [index] = charToUse;
text = new string(tmpBuffer);
}
