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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top