S
shapper
Hello,
I am appending a string to a StringBuilder instance as follows:
paper.AppendFormat("<div id=\"{0}\" class=\"{1}\"></div>", id,
cssClass);
However I would like to add id=\"{0}\" only if "id" is not null or
empty and the same for cssClass and class=\"{1}\".
Is there a conditional way to do this?
I was trying something like
paper.AppendFormat("<div id=\"{0}\" class=\"{1}\"></div>", new object
[] { ... });
with some conditions but I am not getting anywhere.
Thanks,
Miguel
I am appending a string to a StringBuilder instance as follows:
paper.AppendFormat("<div id=\"{0}\" class=\"{1}\"></div>", id,
cssClass);
However I would like to add id=\"{0}\" only if "id" is not null or
empty and the same for cssClass and class=\"{1}\".
Is there a conditional way to do this?
I was trying something like
paper.AppendFormat("<div id=\"{0}\" class=\"{1}\"></div>", new object
[] { ... });
with some conditions but I am not getting anywhere.
Thanks,
Miguel