If it is not solution for you then add comma before entry like
foreach (StringHolder shEntry in ACVMEntries)
{
<skiped>
StringBuilder.Append(",").Append(shEntry.shOldIDNumber);
} // of foreach
// Remove extraneous comma at the end of each StringBuilder.
...
if (StringBuilder.Length>0)
StringBuilder.Remove(0,1); //remove first char if stringbuilder
has some entries
2009/10/14 Raghupathi Kamuni <raghu...@gmail.com>
But that said, I'm guessing there's a fairly simple algorithmic flaw
underlying this problem ...
∞ Andy Badera
∞ +1 518-641-1280
∞ This email is: [ ] bloggable [x] ask first [ ] private
∞ Google me: http://www.google.com/search?q=andrew%20badera
Hello Benj Nunez,
Here I mention what you miss in your code
TmpBuilder.Remove(TmpBuilder.Length - 1, 1); // problem code
TmpBuilder.Remove(TmpBuilder.ToString().Length - 1, 1);// solution to problem
@ Arsalan
Mr.Arsalan I thing your suggestion(First point only) is wrong because Use of StringBuilder is remove string operation (concatenation ) within String buffer.
For eg.
StringBuilderBin1.Append(shEntry.shOldIDNumber + ",");
When you use above code
Two Immutable string concat to new instance of string then finally append to string buffer
in my opinion below line is correct
StringBuilderBin1.Append(shEntry.shOldIDNumber).Append(",");
Here doesn’t create any instance of string it only append to string buffer