System.Text.StringBuilder is the type you want to use for string concatenation operations in a loop. It is going to be far more efficient. Use .Append(value) on the object during each iteration.
StringBuilder builder = new StringBuilder();
// and inside your loop
{
if (blah)
builder.Append("1");
else
builder.Append("0");
}
string output = builder.ToString(); // use the final result