Variable representation in StringBuilder

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I replace the character literals in the stringbuider below with variables?
StringBuilder sData = new StringBuilder("<CABDETAILS CabNumber=\"43877\" CabSKU=\"6633\" ExpDate=\"0106\" />");
For example, I will have a variable representation of "43877" in the stringbulder. variable already declared as string xxxx = "43877"

Thanks.
 
How can I replace the character literals in the stringbuider below with variables?
StringBuilder sData = new StringBuilder("<CABDETAILS CabNumber=\"43877\" CabSKU=\"6633\" ExpDate=\"0106\" />");
For example, I will have a variable representation of "43877" in the stringbulder. variable already declared as string xxxx = "43877"

StringBuilder sData = new StringBuilder();
sData.AppendFormat(
"<CABDETAILS CabNumber=\"{0}\" CabSKU=\"{1}\" ExpDate=\"{2}\" />",
xxxx, yyyy, zzzz );



Mattias
 
Back
Top