I am writing a code generation tool that frequently will have lines like
StringBuilder sp = new Stringbuilder();
sp.AppendFormat(" public {0}TextColumn()\n", className);
sp.AppendLine(" {"
sp.AppendLine(" Column = new DataGridViewTextBoxColumn();");
sp.AppendFormat(" Column.DataPropertyName = \"{0}\";\n", columnName);
However the issue I am having is when I run in to a line like this.
sp.AppendFormat("return String.Format(\"{0} = '{0}'\", cmbList.SelectedValue);", columnName);
I want the first {0}
to turn in to whatever the value of columnName is but I want the seccond {0}
to be left alone so the internal String.Format
will process it correctly.
How do I do this?