Stringbuilder ignores last space
- by chead23
I am initialising a StringBuilder as follows:
StringBuilder builder = new StringBuilder("Symptoms are ");
After this I loop through a list and add each string item to the end using
foreach(var item in list)
{
builder.Append(item);
}
An example item would be something like "headache" but once i've appended it to "Symptoms are " and called builder.ToString() it shows:
"Symptoms areHeadache...etc"
as opposed to
"Symptoms are Headache...etc"
Why is it ignoring the space?