You can just decrease the length to shorten the string (C#):
mstrResult.Length -= 1;
EDIT:
After you updated you question, I think I know what you want 🙂 How about this:
mstrResult.Append(rtbResult.Text).Append("})})" + Environment.NewLine);
var index = mstrResult.ToString().LastIndexOf(',');
if (index >= 0)
mstrResult.Remove(index, 1);